step: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
 
m (Text replacement - "\|x([0-9])= *<code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>")
 
(45 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands|STEP]]
{{RV|type=command
[[Category:Scripting Commands ArmA|STEP]]


|game1= arma1
|version1= 1.00


<h2 style="color:#000066">'''''for /.../'' step ''step'''''</h2>
|game2= arma2
|version2= 1.00


|game3= arma2oa
|version3= 1.50


'''Operand types:'''
|game4= tkoh
|version4= 1.00


'''for /.../:''' [[For Type]]
|game5= arma3
|version5= 0.50


'''step:''' [[Number]]
|gr1= Program Flow


'''Type of returned value:'''
|descr= Optional step value. A countdown can be made with a negative value. If not set, the default step is 1.


[[For Type]]
|s1= for [[step]] stepSize


'''Description:'''
|p1= for: [[For Type]]


Optionally can set step.
|p2= stepSize: [[Number]]


If you want to count down, step must be specified, and set negative.
|r1= [[For Type]]


Default value is 1.  
|x1= <sqf>for "_i" from 20 to 10 step -2 do
{
// ...
};</sqf>


 
|seealso= [[Control Structures]]
'''Example:'''
}}
 
for "_x" from 20 to 10 '''step''' -2 do {..code..}

Latest revision as of 11:25, 13 May 2022

Hover & click on the images for description

Description

Description:
Optional step value. A countdown can be made with a negative value. If not set, the default step is 1.
Groups:
Program Flow

Syntax

Syntax:
for step stepSize
Parameters:
for: For Type
stepSize: Number
Return Value:
For Type

Examples

Example 1:
for "_i" from 20 to 10 step -2 do { // ... };

Additional Information

See also:
Control Structures

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