breakOut: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " \| *s([0-9]) *= ([^ ]+)? ?'''([a-zA-Z0-9_]+)''' ?([^ ]+)? " to " |s$1= $2 $3 $4 ") |
Lou Montana (talk | contribs) m (Text replacement - "\|s1= +" to "|s1= ") |
||
Line 22: | Line 22: | ||
* If multiple scopes with the same '''name''' exist, the command will break out the nearest scope. See '''Example 3'''. | * If multiple scopes with the same '''name''' exist, the command will break out the nearest scope. See '''Example 3'''. | ||
|s1= | |s1= [[breakOut]] name | ||
|p1= name: [[String]] - Name of the scope which was previously set with [[scopeName]]. {{ic|""}} will exit the current scope. | |p1= name: [[String]] - Name of the scope which was previously set with [[scopeName]]. {{ic|""}} will exit the current scope. |
Revision as of 15:42, 19 June 2021
Description
- Description:
- Breaks out of the scope with given name.
- An unknown scopeName name will cause the script error
Generic error in expression
- If multiple scopes with the same name exist, the command will break out the nearest scope. See Example 3.
- An unknown scopeName name will cause the script error
- Groups:
- Program Flow
Syntax
- Syntax:
- breakOut name
- Parameters:
- name: String - Name of the scope which was previously set with scopeName.
""
will exit the current scope. - Return Value:
- Nothing
Alternative Syntax
- Syntax:
- value breakOut name Template:Since
- Parameters:
- value: Anything - A value to return
- name: String - Name of the scope which was previously set with scopeName.
""
will exit the current scope. - Return Value:
- Anything - Will return value
Examples
- Example 1:
scopeName "main"; while {true} do { scopeName "loop1"; while {true} do { scopeName "loop2"; if (condition1) then {breakTo "main"}; // Breaks all scopes and return to "main" if (condition2) then {breakOut "loop2"}; // Breaks scope named "loop2" sleep 1; }; sleep 1; };
- Example 2:
call { scopeName "main"; call { 123 breakOut "main" }; 345 }; // call returns 123
- Example 3:
call { scopeName "Main"; //Parent Main call { scopeName "Main"; //Child Main "String" breakOut "Main"; //Will break out of child main and return "String" to parent main }; };
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Categories:
- Scripting Commands
- Introduced with Armed Assault version 1.00
- ArmA: Armed Assault: New Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Program Flow