Difference between revisions of "Assignn"

From AGI Wiki
Jump to navigationJump to search
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The '''assignn''' command sets the value of a variable to a specified number.
+
The '''assignn''' command assigns a numeric value to a [[variable]].
  
<code>assignn(variable, number);
+
== Syntax ==
variable = number;</code>
 
  
When this command is issued, the value of <code>variable</code> is set to number.
+
assignv([[variable|var]] vA, [[number|byt]] B);<br />
 +
vA = B;
  
==Parameters==
+
== Remarks ==
  
    <code>variable:</code> a variable, <code>v0-v255</code>, which should receive the value of number
+
None.
    <code>number:</code> a number, 0-255, which should be assigned to <code>variable</code>
 
  
==Possible errors==
+
== Possible Errors ==
  
None known.
+
None.
  
==Examples==
+
== Example ==
  
The following example assigns the number 22 to variable <code>v200</code>, using the longhand syntax:
+
<div class="CodeBlockHeader">Code:</div>
 +
<syntaxhighlight lang="agi">
 +
assignv(v50, 75);
 +
v50 = 75;
 +
</syntaxhighlight>
  
<code>assignn(v200, 22);</code>
+
== Technical Information ==
  
The next example assigns the number 35 to variable <code>v207</code>, using the shorthand syntax:
+
{| 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:'''
 +
| 3 (0x03 hex)
 +
|}
  
<code>v207 = 35;</code>
+
== See Also ==
  
See also
+
[[Mathematical Commands]]<br />
 +
'''[[assignv]]'''
  
* [[Assignv|assignv]]
+
[[Category:Commands]]
 
 
Sources
 
 
 
* [[AGIStudioHelp|AGI Studio Help File]]
 
 
 
&nbsp;
 
 
 
[[Category:Logic Commands]]
 
[[Category:Mathematical Commands]]
 

Latest revision as of 20:20, 23 March 2019

The assignn command assigns a numeric value to a variable.

Syntax

assignv(var vA, byt B);
vA = B;

Remarks

None.

Possible Errors

None.

Example

Code:

<syntaxhighlight lang="agi"> assignv(v50, 75); v50 = 75; </syntaxhighlight>

Technical Information

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

See Also

Mathematical Commands
assignv