Difference between revisions of "Assignv"

From AGI Wiki
Jump to navigationJump to search
 
Line 1: Line 1:
The assignv command sets the value of a variable to the value of another [[Variable|variable]].
+
The '''assignv''' command assigns the value from one [[variable]] to another.
  
<code>assignv(variableA, variableB);</code>
+
== Syntax ==
  
<code>variableA = variableB;</code>
+
assignv([[variable|var]] vA, [[variable|var]] vB);<br />
 +
vA = vB;
  
When this command is issued, the value of <code>variableA</code> is set to the value of <code>variableB</code>.
+
== Remarks ==
  
==Parameters==
+
None.
  
* <code>variableA:</code> a variable, <code>v0-v255</code>, which should receive the value of <code>variableB</code>
+
== Possible Errors ==
* <code>variableB:</code> a variable, <code>v0-v255</code>, whose value should be assigned to <code>variableA</code>
 
  
==Possible errors==
+
None.
  
None known.
+
== Example ==
  
==Examples==
+
<div class="CodeBlockHeader">Code:</div>
 +
<syntaxhighlight lang="agi">
 +
assignv(v50, v51);
 +
v50 = v51;
 +
</syntaxhighlight>
  
The following example assigns the value of variable <code>v30</code> to variable <code>v200</code>, using the longhand syntax:
+
== Technical Information ==
  
assignv(v200, v30);
+
{| border="1" cellpadding="2"
 +
| style="background-color: #efefef" width="200" | '''Required Interpreter Version:'''
 +
| width="175" | Available in all AGI versions.
 +
|-
 +
| style="background-color: #efefef" | '''Byte-Code Value:'''
 +
| 4 (0x04 hex)
 +
|}
  
The next example assigns the value of variable <code>v98</code> to variable <code>v207</code>, using the shorthand syntax:
+
== See Also ==
  
<code>v207 = v98;</code>
+
[[Mathematical Commands]]<br />
 +
'''[[assignn]]'''<br />
  
==See also==
+
[[Category:Commands]]
 
 
* [[Assignn|assignn]]
 
 
 
==Sources==
 
 
 
* [[AGI Studio]] help file
 
 
 
&nbsp;
 
 
 
[[Category:Logic Commands]]
 
 
[[Category:Mathematical Commands]]
 
[[Category:Mathematical Commands]]

Latest revision as of 17:13, 23 March 2019

The assignv command assigns the value from one variable to another.

Syntax

assignv(var vA, var vB);
vA = vB;

Remarks

None.

Possible Errors

None.

Example

Code:
assignv(v50, v51);
v50 = v51;

Technical Information

Required Interpreter Version: Available in all AGI versions.
Byte-Code Value: 4 (0x04 hex)

See Also

Mathematical Commands
assignn