Equalv

From AGI Wiki
Revision as of 14:23, 30 March 2019 by Andrew Korson (talk | contribs) (Created page with "The '''equalv''' command compares the values of two variables. It returns TRUE if the values are equal. == Syntax == equalv(var vA, [[variable|var]...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The equalv command compares the values of two variables. It returns TRUE if the values are equal.

Syntax

equalv(var vA, var vB)
vA == vB

Remarks

Test commands are only valid in an if statement. This statement can be combined with the NOT operator to create a ‘not equal’ test.

Possible Errors

None.

Example

Code:

<syntaxhighlight lang="agi"> if(v50 == v51) [ equivalent to 'if(equalv(v50, v51))'

 {
 print("v50 equals v51");
 }

if(v50 != v51) [ equivalent to 'if(!equalv(v50, v51))'

 {
 print ("v50 does not equal v51");
 }

</syntaxhighlight>

Technical Information

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

See Also

Test Commands
equaln