 |
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: 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?
|
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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. |
|
|
|
 |
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: 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.
|
|
|
|
 |
|
|
|