breakOut: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\|x([0-9])= *<code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 19: | Line 19: | ||
|descr= Breaks out of the [[Variables#Scopes|scope]] with given '''name'''. | |descr= Breaks out of the [[Variables#Scopes|scope]] with given '''name'''. | ||
* An unknown [[scopeName]] name will cause the script error {{ | * An unknown [[scopeName]] name will cause the script error {{hl|Generic error in expression}} | ||
* If multiple scopes with the same '''name''' exist, the command will break out the nearest scope. See | * If multiple scopes with the same '''name''' exist, the command will break out the nearest scope. See {{Link|#Example 3}}. | ||
|s1= [[breakOut]] name | |s1= [[breakOut]] name | ||
|p1= name: [[String]] - Name of the scope which was previously set with [[scopeName]]. | |p1= name: [[String]] - Name of the scope which was previously set with [[scopeName]]. <sqf inline>""</sqf> will exit the current scope (see also [[exitWith]]) | ||
|r1= [[Nothing]] | |r1= [[Nothing]] | ||
Line 34: | Line 34: | ||
|p21= value: [[Anything]] - A value to return | |p21= value: [[Anything]] - A value to return | ||
|p22= name: [[String]] - Name of the scope which was previously set with [[scopeName]]. | |p22= name: [[String]] - Name of the scope which was previously set with [[scopeName]]. <sqf inline>""</sqf> will exit the current scope (see also [[exitWith]]) | ||
|r2= [[Anything]] - Will return '''value''' | |r2= [[Anything]] - Will return '''value''' | ||
|x1= <sqf>scopeName "main"; | |x1= <sqf>scopeName "main"; | ||
while {true} do { | while { true } do { | ||
scopeName "loop1"; | scopeName "loop1"; | ||
while {true} do { | while {true} do { |
Revision as of 16:47, 25 July 2022
Description
- Description:
- Breaks out of the scope with given name.
- 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 (see also exitWith)
- Return Value:
- Nothing
Alternative Syntax
- Syntax:
- value breakOut name
- Parameters:
- value: Anything - A value to return
- name: String - Name of the scope which was previously set with scopeName. "" will exit the current scope (see also exitWith)
- Return Value:
- Anything - Will return value
Examples
- Example 1:
- Example 2:
- Example 3:
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