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

 Related 
Contents
Variables
  #LOCAL
  #NEWVAR
  #RESET
  #VARFUNC
  Variables
Command Reference
  #nnn
  #ABORT
  #ACTION
  #ADD
  #ADDITEM
  #ADDKEY
  #AFK
  #ALARM
  #ALIAS
  #ALL
  #BACKUP
  #BEEP
  #BREAK
  #BUTTON
  #C-
  #C+
  #CALL
  #CAPTURE
  #CASE
  #CHARACTER
  #CLASS
  #CLOSE
  #CLR
  #CMD
  #COLOR
  #COM
  #CONDITION
  #CONFIGURE
  #CONNECT
  #CONTINUE
  #CR
  #CW
  #DBCLOSE
  #DBDELETE
  #DBFIRST
  #DBGET
  #DBLOAD
  #DBNEXT
  #DBOFFLINE
  #DBONLINE
  #DBPREV
  #DBPUT
  #DBRESET
  #DBSAVE
  #DDE
  #DEBUG
  #DEBUGFILE
  #DEFAULT
  #DELCLASS
  #DELITEM
  #DELKEY
  #DELNITEM
  #DESCRIBE
  #DIRECTION
  #DISCONNECT
  #DOOR
  #ECHO
  #ECHOPROMPT
  #EDITOR
  #ERASE
  #EVALUATE
  #EVENT
  #EXECUTE
  #EXECWIN
  #EXIT
  #FILE
  #FIND
  #FIRE
  #FORALL
  #FREEZE
  #FTP
  #FUNCTION
  #GAG
  #GAGBLOCK
  #GAGLOG
  #GAGOFF
  #GAGON
  #GAGSPACE
  #GAUGE
  #H-
  #H+
  #HELP
  #HIGHLIGHT
  #HISTLOAD
  #HISTORY
  #HISTSAVE
  #HOST
  #IF
  #IGNORE
  #IMAGE
  #INPUT
  #KEY
  #KILLALL
  #LAUNCH
  #LMAP
  #LOAD
  #LOCAL
  #LOCATION
  #LOG
  #LOOK
  #LOOP
  #LOOPDB
  #LOOPVIEW
  #LUA
  #MAKEROOM
  #MAKEWINDOW
  #MAP
  #MAPQUERY
  #MARK
  #MATH
  #MEDIA
  #MENU
  #MERGE
  #MESSAGE
  #MODULE
  #MOVE
  #MSS
  #MXP
  #MXPTRIG
  #NAME
  #NEW
  #NEWVAR
  #NODEF
  #NODIR
  #NOINPUT
  #NOMAP
  #NOOP
  #NOSAVE
  #OK
  #ONINPUT
  #PATH
  #PATHHIGH
  #PAUSE
  #PCOL
  #PICK
  #PLAY
  #PLUGIN
  #PORTAL
  #PRINT
  #PROMPT
  #PSUB
  #PUEBLO
  #PW
  #QUERY
  #QUEUE
  #RAISEEVENT
  #READ
  #RECALL
  #RECORD
  #REGEX
  #RENAME
  #REPEAT
  #RESET
  #RESUME
  #RESULT
  #RETRACE
  #RETURN
  #SAVE
  #SAY
  #SAYADD
  #SAYPROMPT
  #SCRIPT
  #SCROLL
  #SECTION
  #SEND
  #SENDGMCP
  #SENDPROMPT
  #SENDRAW
  #SENDSB
  #SESSION
  #SET
  #SETPROMPT
  #SHOW
  #SHOWARR
  #SHOWDB
  #SHOWPROMPT
  #SHOWTABLE
  #SIGNAL
  #SLOW
  #SORT
  #SQLCLOSE
  #SQLDB
  #SS
  #STATE
  #STATUS
  #STEP
  #STOP
  #STWIN
  #STYLE
  #SUBSTITUTE
  #SUSPEND
  #SWITCH
  #T-
  #T?
  #T+
  #TAB
  #TAG
  #TELEPORT
  #TEMP
  #TEMPVAR
  #THREAD
  #TIMER
  #TRACK
  #TRIGGER
  #TSET
  #TYPE
  #TZERO
  #UNALIAS
  #UNBUTTON
  #UNCLASS
  #UNDIR
  #UNGAG
  #UNKEY
  #UNEVENT
  #UNLOAD
  #UNLOC
  #UNMENU
  #UNPATH
  #UNPORTAL
  #UNSTYLE
  #UNTAB
  #UNTIL
  #UNTRIGGER
  #UNVAR
  #UPDATE
  #URL
  #VARFUNC
  #VARIABLE
  #VERBATIM
  #VERSION
  #VIEW
  #WAIT
  #WAITFOR
  #WAITSIGNAL
  #WAITTHREAD
  #WALK
  #WHILE
  #WINDOW
  #WITHLOC
  #WIZLIST
  #WRAP
  #WRITE
  #WRITELOG
  #YESNO
Related Links:
  %additem
  %array
  %arrget
  %arrhigh
  %arrset
  %begins
  %case
  %comactive
  %comcreate
  %comget
  %comset
  %concat
  %countlist
  %defined
  %delitem
  %ends
  %expand
  %ismember
  %isnumber
  %mapquery
  %null
  %pick
  %pop
  %push
  %random
  %replace
  %replaceitem
  %sort
  %stripq
  #ALARM
  #ALIAS
  #CALL
  #COM
  #EVALUATE
  #MSS
  #PICK
  #TAG
  #UNTIL
  #UNVAR
  #WHILE
  #NEWVAR
  Introduction to Variables
  Introduction to Classes
  Terminology
  Variables
  Variables
#VARIABLE [[cmud_#VA]] 
VARIABLE

Syntax: #VA varname value defaultval classname

Similar to the #ALIAS command. Assigns the specified value to the varname variable. You should leave off the @ variable character. This allows you to define variables independent of the user's variable character setting.

An alternative syntax is
variable = value
or
variable := value

If a defaultval is specified, the variable is initialized to that value when the settings are loaded or the #RESET command is used. To specify no default, leave this parameter out or use the _nodef value.

When used without any parameters all variables are displayed. If variable is the only parameter then just its value is displayed.

Normally, variables are "auto-typed". This means that CMUD automatically converts the variable contents to numbers or strings as needed by your script. The "type" of a variable can be explicitly changed in the Pakage Editor, or by using the %vartype function.

This command can also be used to set the value of local variables. The $ local variable character must be used to set the value of a local variable. You should be careful when using local variable names and #var to avoid problems.

VARIABLE examples

#VA coins 1000
assign 1000 to the @coins variable

coins = 1000
same as above.

#VA people john mary joseph
This creates the variable @people in the class joseph with a value of john and a default of mary. To have the value be john mary joseph use braces to separate the parameters: #VA people {john mary joseph}

#VA simple abc
#VA @simple def
This one creates the variable @simple with a value of abc. Then creates the variable @abc with a value of def. You should never have an @ in the variable name unless you plan to create an indirect reference such as this.

$name=Zugg;#VA $name cool
Sets the value of the $name local variable to "Zugg" and then changes its value to "cool".

$name=Zugg;#VA %eval($name) cool
Sets the value of the $name local variable to "Zugg" and then sets the value of the global variable @Zugg to "cool".
Viewer Comments [0 - Post your comments]

Jump to:  

© 2009 Zugg Software. Hosted by Wolfpaw.net