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:
Return
+
The '''return''' command terminates logic script execution.
  
==<br /> Description ==
+
== Syntax ==
  
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).
+
return();
  
==<br /> Syntax ==
+
== Remarks ==
  
<div class="CodeBlockHeader">AGI Code:</div>
+
'''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.
<syntaxhighlight lang="agi">
+
 
return();</syntaxhighlight>
+
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]].
  
This command is required at the end of every logic.
+
== Possible Errors ==
  
==<br /> Sources ==
+
None.
  
* [[agi:AGIStudioHelp|AGI Studio Help File]]
+
== Example ==
  
==<br /> References ==
+
<div class="CodeBlockHeader">Code:</div>
 +
<syntaxhighlight lang="agi">
 +
return();
 +
</syntaxhighlight>
  
<references />
+
== Technical Information ==
  
==<br /> See Also ==
+
{| 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 ==
  
[[Category:References]]
+
[[Flow Control Commands]]<br />
[[Category:Logic]]
+
'''[[call]]'''<br />
[[Category:Logic Commands]]
+
[[Category:Commands]]<br />
[[Category:Control Flow Commands]]
 

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)

See Also

Flow Control Commands
call