Lessv: Difference between revisions

From Sierra Wiki
Jump to navigationJump to search
Andrew Branscom (talk | contribs)
No edit summary
Andrew Branscom (talk | contribs)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:AGI Pages]]
[[Category:AGI Pages to be Edited]]
[[AGI Logic Commands by Name|Return to AGI Logic Commands by Name]]
<div align="center"><span style="font-size: 22pt">lessv</div>
<br />
==<br /> Introduction ==
The '''lessv''' command compares the values of two [[Variable (AGI)|variables]]. It returns TRUE if the value of the first variable is less than the value of the second variable.
The '''lessv''' command compares the values of two [[Variable (AGI)|variables]]. It returns TRUE if the value of the first variable is less than the value of the second variable.


Line 52: Line 61:
==<br /> Related Links ==
==<br /> Related Links ==


* [[Test Commands]]
* [[AGI Command Reference - Test Commands|Test Commands]]
* [[lessn]]
* [[lessn]]
<br />&nbsp;
[[AGI Logic Commands by Name#Commands|< AGI Logic Command Index]]
&nbsp;
&nbsp;
[[Category:Commands]]
[[Category:Commands]]
[[Category:AGI Logic Commands]]
[[Category:AGI Logic Commands]]

Latest revision as of 18:11, 4 April 2025

Return to AGI Logic Commands by Name

lessv



Introduction

The lessv command compares the values of two variables. It returns TRUE if the value of the first variable is less than the value of the second variable.

Syntax

lessv(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 ‘greater than or equal to’ test.

Possible Errors

None.

Example

Code:
if(lessv(v50, v51))
  {
  print("v50 is less than v51");
  }

if(v50 < v51)  [ alternate syntax
  {
  print("v50 is less than v51");
  }

if(v50 >= v51) [ equivalent to 'if(!lessv(v50, v51))'
  {
  print ("v50 is greater than or equal to v51");
  }

Technical Information

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


References



Related Links


  < AGI Logic Command Index