[↑]
SmileBASIC4 Replica Reference
FOR
Repeat the process a specified number of times

FOR LoopVariable=InitialValue TO EndValue
FOR LoopVariable=InitialValue TO EndValue STEP Increment

・Place a NEXT command at the end of the process.
・If the condition is not met, it may not be executed even once.

Arguments

LoopVariable

Variable that is automatically updated on every loop

・Increment is added for each loop.

InitialValue

The value of the loop variable at the start of the loop

TO EndValue

The value of the loop variable that terminates the loop

・When the value of the loop variable exceeds this value, the loop is terminated.

STEP Increment

・An increment to add to the loop variable at the end of the loop.
・If not specified, 1 is used as the increment value.
・If a negative number is specified, the value can be looped in a decreasing direction.
・If the increment is a decimal, it may not be the intended number of times due to calculation error.

Example

FOR I=0 TO 9 STEP 2
 PRINT I;",";
NEXT
About this site
Our site is an unofficial manual site of programming software "SmileBASIC" for NintendoSwitch™.
I acquire the content of the site from the official reference site of the SmileBoom Co.Ltd. that is the development and sales cause of the software in real time (a minimum period of 24 hours update) and display it. For automatic update, contents may become improper.
Please confirm the correct content in an official site.

June 3, 2020
by mim
OK
|