-
Notifications
You must be signed in to change notification settings - Fork 0
break and continue
Grisgram edited this page Dec 29, 2024
·
8 revisions
These statements allow a more detailed control flow inside a loop.
They work identical to break and continue you know from gml or other languages.
break
continue
- Exits the loop immediately, bypassing the exit condition.
- The script resumes execution at the first line after the loop.
Example:
for i = 1 to 10
if i == 5 break
// Loop ends when i equals 5
next- Skips the remaining code in the current iteration.
- Immediately jumps back to the beginning of the loop to reevaluate the exit condition.
Example:
for i = 1 to 10
if i % 2 == 0 continue
// This code runs only for odd numbers
nextBack 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