This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:for [2016/01/01 22:41] 127.0.0.1 external edit |
en:for [2020/04/26 22:26] (current) admin |
||
---|---|---|---|
Line 1: | Line 1: | ||
===== For / Next (Statement) ===== | ===== For / Next (Statement) ===== | ||
==== Format ==== | ==== Format ==== | ||
- | **for** | + | **for** |
- | (tab)//statement(s)//\\ | + | (tab)[[programsyntax|statement(s)]]\\ |
- | **next** | + | **next** |
==== Description ==== | ==== Description ==== | ||
- | The FOR and NEXT commands are used in conjunction to execute a command or group of commands a specified number of times. When the FOR command is first encountered, | + | The FOR and NEXT commands are used in conjunction to execute a command or group of commands a specified number of times. When the FOR command is first encountered, |
- | After each NEXT command, | + | After each NEXT command, |
+ | |||
+ | ==== Example ==== | ||
+ | < | ||
+ | for i = 1 to 5 | ||
+ | print i | ||
+ | next i | ||
+ | |||
+ | print "after the for " + i | ||
+ | |||
+ | for k = 5 to 1 step -1 | ||
+ | ? k | ||
+ | next | ||
+ | </ | ||
+ | displays | ||
+ | < | ||
+ | 1 | ||
+ | 2 | ||
+ | 3 | ||
+ | 4 | ||
+ | 5 | ||
+ | after the for 6 | ||
+ | 5 | ||
+ | 4 | ||
+ | 3 | ||
+ | 2 | ||
+ | 1 | ||
+ | </ | ||
==== See Also ==== | ==== See Also ==== | ||
{{page> | {{page> | ||
+ | |||
+ | ==== History ==== | ||
+ | |2.0.0.0|Variable in Next statement is now optional| |