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: Tue Mar 10, 2009 7:36 pm   

[3.04] #YESNO again
 
http://forums.zuggsoft.com/forums/viewtopic.php?t=31536

It seems that #YESNO doesn't like local variables?
Code:

$sourceType = -1
#YESNO "What you wanna fix today?" {A Bug!:$sourceType=-2} {Left that bug alone!:#PRINT "It's really not a bug! 8-)"}
#PRINT $sourceType


And, btw, why it displays a red cross icon?
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Mar 10, 2009 8:06 pm   
 
That is correct. Because of the obscure syntax left over from zMUD for specifying the caption of the button, the text in the {} is passed to the #EVAL routine, which causes it to get parsed and then compiled. This means it doesn't have access to the previous local variables in the original script (because it has a new runtime stack).

I'll add this to the wish-list for the future, but I'm not sure I can implement this properly and maintain the compatibility with the zMUD syntax for button captions. The fact that the "A Bug!:" syntax represents a button caption instead of a normal window: reference means that CMUD cannot call the normal command parser in this situation.

The red cross icon is the "cancel" icon for cancelling the #YESNO without executing either script option. That is the same as in zMUD and has been there for years.
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