About Us
Products
Purchase
Downloads
Support
Forums
Contact Us
Site
 Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Mon Jan 05, 2009 6:23 pm   

[3.03a] Is %window func acts as designed?
 
From the help:
Syntax: %window(name)
Return true if the specified window name is currently open.

Code:

#WIN "Test"
#PRINT %window("TestA")
#PRINT %window("Test")
#PRINT %window("Tes")
#PRINT %window("Te")
#PRINT %window("T")
#PRINT %window("")


Output:
0
1
1
1
1

0
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Mon Jan 05, 2009 8:49 pm   
 
I believe it is... although it may not quite be what you would expect.

The behavior is consistent with both CMUD 2.37 and zMUD 7.21 (which is expected since the function has been around for some time. The thing is that the function doesn't do an exact match, so if you provide a string and the string is the starting portion of a window name then it will return true.

It's debatable if it should be the behavior. I'll start a poll and let Zugg decide. Since it's pretty old changing it may break compatibility with old scripts which does reduce the likelihood he'll want to change it.
_________________
Asati di tempari!
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Jan 05, 2009 10:36 pm   
 
Yes, it's a left-over for zMUD compatibility. Window names have always allowed partial matches. In your example, you have always been able to do:

t:hello

to send something to whatever window starts with a "t" (like "test").
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Mon Jan 05, 2009 11:31 pm   
 
Thanks for your explanations. And yes, it is not what I would expect... although I can live with it.

Tech, could you add a note to the help topic instead of a poll? Wink
_________________
My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net