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

Difference between revisions of "SETV"

From Creatures Wiki
Jump to navigation Jump to search
 
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<b>SETV</b> is a [[CAOS]] command used to set a [[variable]] to a specific value.
+
'''SETV''' is a [[CAOS]] command used to set a [[variable]] to a specific value.
  
 
==Usage==
 
==Usage==
Syntax: <i>SETV X(int or float variable) Y(int or float)</i>
+
Syntax: ''SETV var (variable) val (int or float)''
  
Standalone command. <br />
+
Set ''var'' to ''val''. Any previous value of ''var'' is overwritten. The type of ''var'' will match that of ''val''.
Sets X to Y.<br />
 
  
 
==Examples==
 
==Examples==
<i>SUBV</i> being used to set a variable to 1:
+
''SETV'' in conjuction with [[DIVV]] to divide on an imaginary command line:
 
<pre>
 
<pre>
SETV va02 1
+
SETV va00 10
 +
DIVV va00 2
 +
OUTV va00
 +
    5
 
</pre>
 
</pre>
  
 
==See also==
 
==See also==
*[[ADDV]]
+
*[[OUTV]] for output
*[[SUBV]]
+
*The following commands relate to variable arithmetic: [[ADDV]], [[SUBV]]; [[MULV]], [[DIVV]], [[MODV]]; [[NEGV]], [[ABSV]].
 +
*The following commands are bitwise operations on integers: [[ANDV]], [[ORRV]], [[NOTV]].
 +
 
 +
*[[VTOS]] converts between decimal and string
 +
*[[SETS]] and [[SETA]] for strings and agents, respectively
 +
 
 +
==External links==
 +
*[https://web.archive.org/web/20050312122919/http://www.freewebs.com/alimaggs/creaturesdev/cdn/c3/knowledgebase/c3_data.html Discussion of data types within CAOS] at an archive of the [[CDN]].
 +
 
 
[[Category:C3 CAOS Commands]]
 
[[Category:C3 CAOS Commands]]

Latest revision as of 01:32, 19 July 2022

SETV is a CAOS command used to set a variable to a specific value.

Usage[edit]

Syntax: SETV var (variable) val (int or float)

Set var to val. Any previous value of var is overwritten. The type of var will match that of val.

Examples[edit]

SETV in conjuction with DIVV to divide on an imaginary command line:

SETV va00 10
DIVV va00 2
OUTV va00
    5

See also[edit]

  • VTOS converts between decimal and string
  • SETS and SETA for strings and agents, respectively

External links[edit]