Return

From AGI Wiki
Revision as of 22:16, 19 April 2019 by Andrew Korson (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The return command terminates logic script execution.

Syntax

return();

Remarks

return commands can be used anyplace in code where termination of the logic script is desired, but all logic scripts must end with a return command.

When a logic script execution terminates, control returns to the calling logic script, immediately following the call command. In the case of logic 0, the return command causes AGI to begin another interpreter cycle.

Possible Errors

None.

Example

Code:

<syntaxhighlight lang="agi"> return(); </syntaxhighlight>

Technical Information

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

See Also

Flow Control Commands
call