Welcome to the Creatures Wiki! Log in and join the community.

Difference between revisions of "VAxx"

From Creatures Wiki
Jump to navigation Jump to search
(make. sure i've missed something...)
 
m (see also)
Line 24: Line 24:
 
   "Hello world!" said Jamie.
 
   "Hello world!" said Jamie.
 
</pre>
 
</pre>
 +
 +
==See also==
 +
* [[Variable]] gives an overview of the system
 +
* [[OVxx]] and [[MVxx]] are non-local variables
 +
* [[NAME]] handles named local variables
  
 
[[category:C3 CAOS Commands]]
 
[[category:C3 CAOS Commands]]

Revision as of 19:27, 23 January 2006

VAxx is the name given to a family of CAOS commands which represent variables.

The VAxx family are variables which are local to the script running. There are 100 of them, named from VA00 through to VA99. When a script begins running, they are initially all 0 (integer type), but can be assigned any value.

Because they are local, they cannot be used to share information about state between the scripts of an agent, or between agents. Commands like MESG WRIT and CALL, which allow execution to pass to another script, do not preserve local variables. GSUB, because execution stays inside the script, does. CAOS is a special case: it may or may not preserve VAxx variables depending on an argument.

Examples

Playing with some variables (first numbers, then strings):

SETV va00 5
OUTV va00
  5
ADDV va00 10.5
OUTV va00
  15.500000

SETS va01 "Hello, world!"
OUTS va01
  Hello, world!
SETS va02 "\""
ADDS va02 va01
ADDS va02 "\" said Jamie."
OUTS va02
  "Hello world!" said Jamie.

See also

  • Variable gives an overview of the system
  • OVxx and MVxx are non-local variables
  • NAME handles named local variables