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
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Thu Dec 13, 2007 4:58 am   

[2.16] %null() only works with strings now.
 
Previously I used null to return 0 if an integer variable was 0. I recently have seen this only works on strings now. Was this just another example of loose Zmud parsing?
Reply with quote
Zugg
MASTER


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

PostPosted: Thu Dec 13, 2007 5:25 am   
 
Yes. A zero numeric value is not supposed to be a "null" value. %null should be used for empty strings, but mainly for testing to see if COM variables are assigned.

CMUD properly handles the true/false for variables now. So just testing the value directly can be used instead of %null. For example, if your numeric variable is called @myvar, just doing:

#IF (@myvar) {true} {false}

will work properly. And this works for all types of variables now, so %null should be rarely needed anymore.
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Thu Dec 13, 2007 6:46 am   
 
Thanks for the clarification and details. I remember using it in Zmud for just that purpose... sometime it was the only way to get variables evaluated correctly. You might want to add a note in the conversion notes about this. I tracked an error down in my code to this and I was sure I had found a bug, until I looked it up in the docs and saw that sure enough it was only for empty strings.
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