continueWith: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(page created (needs example still))
 
m (Some wiki formatting)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command


|arma3dev|Game name=
|game1= arma3
|version1= 2.02


|2.02|Game version=
|gr1= Program Flow


|gr1= Program Flow |GROUP1=
|descr= Skips the current loop iteration, continues with the next one and returns the given value.


| Skips current loop iteration and continues with the next one and returns given value.|DESCRIPTION=
|s1= [[continueWith]] return


| [[continueWith]] return |SYNTAX=
|p1= return: [[Anything]] - value to be returned when iteration is skipped


|p1= return: [[Anything]] - Value to be returned when interation is skipped |PARAMETER1=
|r1= [[Anything]]


| [[Nothing]] |RETURNVALUE=  
|x1= <sqf>
// results in [2, "TEST", 4]
private _result = [1, 2, 3] apply {
if (_x == 2) then {
continueWith "TEST";
} else {
_x + 1;
};
};
</sqf>


|x1= <code></code>|EXAMPLE1=
|seealso= [[continue]] [[break]] [[breakWith]]
 
| [[continue]] [[break]] [[breakWith]] |SEEALSO=
}}
}}

Latest revision as of 16:27, 4 May 2022

Hover & click on the images for description

Description

Description:
Skips the current loop iteration, continues with the next one and returns the given value.
Groups:
Program Flow

Syntax

Syntax:
continueWith return
Parameters:
return: Anything - value to be returned when iteration is skipped
Return Value:
Anything

Examples

Example 1:
// results in [2, "TEST", 4] private _result = [1, 2, 3] apply { if (_x == 2) then { continueWith "TEST"; } else { _x + 1; }; };

Additional Information

See also:
continue break breakWith

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