-
Notifications
You must be signed in to change notification settings - Fork 0
return (without gosub)
Grisgram edited this page Feb 6, 2025
·
1 revision
return <expression>
The return command is also a simple way to terminate a script. It functions similarly to the return statement in other programming languages.
If you add an expression to the return statement, this becomes the return value of the script.
You can access the return value in GML through scriptor.get_result().
You can return anything, just like you can return anything with a GML "return" statement.
You have 2 ways to access the result in GML:
- As direct return value like
var result = scriptor.run(); - Any time after the
.run()call throughscriptor.get_result();
Note
The result of a preceding run is reset, when the .run() method of a scriptor is invoked (again).
Back to Repo ● Wiki Home
Copyright © coldrock.games
- Home
- Scriptor Contents
- Scriptor Configuration
- Notepad⁺⁺ Integration
- Create a Script
- $ Variables
- Call a GML Function
- Scriptor global functions
- #-Commands
- The Scriptor Broker
- Broker Events
- Self-Registering Scripts
- Registering Broker Events
- Scriptor Broker File Format
- Extending Scriptor
- var
- new
- goto
- gosub and return
- return (without gosub)
- call
- reset
- Loops
- Conditionals