Reset.scan.start
The reset.scan.start command resets the entry point for a logic script back to the start.
Syntax
reset.scan.start();
Remarks
When logic scripts are executed, they usually start at the very beginning. The set.scan.start command can be used to change the starting point of a logic script. This can be useful if a logic has a large section at the beginning that only needs to be executed once.
When the reset.scan.start command is executed, AGI resets the scan start table so subsequent calls to this logic will again begin execution at the beginning of the logic.
In the following example, you will only see the first message one time. After that, the logic begins execution at the second print statement. If flag f99 is set to TRUE at some point, the scan point is reset back to the beginning, and the next iteration will show the first command again.
Possible Errors
None.
Example
<syntaxhighlight lang="agi"> print("this is first command."); set.scan.start(); [ subsequent calls to this logic will start at the
[ command following this call to set.scan.start
print("this is second command."); if(isset(f99))
{ reset.scan.start(); }
</syntaxhighlight>
Technical Information
Required Interpreter Version: | Available in all AGI versions. |
Byte-Code Value: | 146 (0x92 hex) |