Register to post in forums, or Log in to your existing account
 

 Related 
Contents
Changes for zMUD users
  Importing zMUD files
  New Features
  New Commands
  New Functions
  Compiled scripts
  [] and <> syntax removed
  %%1 syntax removed
  AND OR operators changed
  Class specifier changes
  #PRIORITY command
  Quotes around %1..%99
  #VAR command
  #MENU command
  64-bit integers
  #GALIAS and #GVAR
  %lastcom
  Expression optimization
  Aliases (Auto-append)
  atconnect alias replaced with Events
  #GAG in #ONINPUT trigger
  #T+ vs #CLASS
  Tab completion changes
  Multi-threaded #WAIT
  %btncol arguments reversed
  Multiplaying :window: syntax
  Start lines with commands
  #FUNCTION command
  Variable assignment syntax
#VAR command [[cmud_changes_var]] 
In zMUD, the #VAR command would expand variable references, but would not evaluate any expressions. To evaluate an expression, you had to use either the [] syntax that no longer exists in CMUD, or the %eval function was used, or you used the #MATH command instead of the #VAR command. This caused a lot of confusion for new users.

In CMUD, the #VAR command will evaluate expressions as expected. To prevent this evaluation, put {} around the value. In CMUD, {} works similar to "" quotes. The difference is that variables are expanded within {}, but not expanded within "".

For example:
Code:
zMUD:
a = 2
#VAR b @a+1    ; actually stores "2+1" in @b
#FUNC b @a+1   ; stores "@a+1" in @b
#MATH b @a+1   ; stores 3 in @b

CMUD:
a = 2
#VAR b @a+1    ; stores 3 in @b
#VAR b {@a+1}  ; stores "2+1" in @b
#VAR b "@a+1"  ; stores "@a+1" in @b
#VAR b (@a+1)  ; stores 3 in @b

The #MATH command can still be used in CMUD - #VARFUNC is the equivalent of the zMUD command #FUNC
Viewer Comments [0 - Post your comments]

Jump to:  

© 2009 Zugg Software. Hosted by Wolfpaw.net