Issetv: Difference between revisions

From Sierra Wiki
Jump to navigationJump to search
Andrew Branscom (talk | contribs)
No edit summary
Andrew Branscom (talk | contribs)
Line 18: Line 18:
Test commands are only valid in an <code>if</code> statement.
Test commands are only valid in an <code>if</code> statement.


The '''issetv''' command returns TRUE if the [[flag]] whose number matches the value of '''vA''' is set, FALSE if it is not. For example, if v50 equals 40, then <code>issetv(v50)</code> returns TRUE if [[flag]] f40 is set.
The '''issetv''' command returns TRUE if the [[Flag (AGI)|flag]] whose number matches the value of '''vA''' is set, FALSE if it is not. For example, if v50 equals 40, then <code>issetv(v50)</code> returns TRUE if [[Flag (AGI)|flag]] f40 is set.


This statement can be combined with the <code>NOT</code> operator to create an &lsquo;indirect flag not set&rsquo; test.
This statement can be combined with the <code>NOT</code> operator to create an &lsquo;indirect flag not set&rsquo; test.

Revision as of 18:38, 3 April 2025

Return to AGI Logic Commands by Name

Issetv



Introduction

The issetv command returns the value of a flag indirectly.

Syntax

issetv(var vA)

Remarks

Test commands are only valid in an if statement.

The issetv command returns TRUE if the flag whose number matches the value of vA is set, FALSE if it is not. For example, if v50 equals 40, then issetv(v50) returns TRUE if flag f40 is set.

This statement can be combined with the NOT operator to create an ‘indirect flag not set’ test.

Possible Errors

None.

Example

Code:
v50 = 40;
if(issetv(v50))
  {
  print("flag 40 is set");
  }

Technical Information

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


References



Related Links