Difference between revisions of "Return"
From AGI Wiki
Jump to navigationJump to search (Created page with "Return ==<br /> Description == Ends execution of the current logic and returns to the logic that called it (or in the case of logic 0, goes on to the next interpreter cycle)...") |
|||
Line 1: | Line 1: | ||
− | + | 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. | |
− | + | ||
− | return | + | 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 == | |
− | ==< | + | <div class="CodeBlockHeader">Code:</div> |
+ | <syntaxhighlight lang="agi"> | ||
+ | return(); | ||
+ | </syntaxhighlight> | ||
− | + | == Technical Information == | |
− | == | + | {| border="1" cellpadding="2" |
+ | | style="background-color: #efefef" width="200" | '''Required Interpreter Version:''' | ||
+ | | width="175" | Available in all AGI versions. | ||
+ | |- | ||
+ | | style="background-color: #efefef" | '''Byte-Code Value:''' | ||
+ | | 0 (0x00 hex) | ||
+ | |} | ||
− | + | == See Also == | |
− | [[ | + | [[Flow Control Commands]]<br /> |
− | [[ | + | '''[[call]]'''<br /> |
− | [[Category: | + | [[Category:Commands]]<br /> |
− |
Latest revision as of 22:16, 19 April 2019
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) |