step
Purpose
Specifies the increment value of the loop index variable
Description
The loop is executed until the value of the loop index variable goes from the start value to one step before the end value in increments of step
Syntax
for index = start to end step amount loop ... repeat // Loop over values with step
Arguments
index loop index variable
start start value of index
end end value of index (loop is not executed with this value)
amount amount to change index variable (default is one)
Example
clear()
radians( true )
centre = { gwidth() / 2, gHeight() / 2 }
for angle = 0 to 2 * pi step 0.005 loop
col = { random( 101 ) / 100, random( 101 ) / 100, random( 101 ) / 100, 1.0 }
result = sinCos( angle )
point = { 600 * result.y + centre.x, 300 * result.x + centre.y }
line( centre, point, col )
repeat
update()
sleep( 3 )
Associated Commands