FOR

From Smart Box
Revision as of 19:06, 6 October 2023 by Benryves (talk | contribs) (Created page with "== Syntax == FOR number TIMES == Description == The command FOR is used to begin a FOR...NEXT loop. This makes the computer execute a series of lines a specified number of times. The word TIMES is optional. FOR...NEXT loops can be nested up to 40 deep. The maximum loop value is 255. == Example == To print the value of sensor a 5 times at 1 second intervals. FOR 5 TIMES PRINT SENSOR A WAIT 1 NEXT == Associated keywords == * NEXT Category:Reference C...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Syntax[edit]

FOR number TIMES

Description[edit]

The command FOR is used to begin a FOR...NEXT loop. This makes the computer execute a series of lines a specified number of times. The word TIMES is optional. FOR...NEXT loops can be nested up to 40 deep. The maximum loop value is 255.

Example[edit]

To print the value of sensor a 5 times at 1 second intervals.

FOR 5 TIMES
PRINT SENSOR A
WAIT 1
NEXT

Associated keywords[edit]