20060301
For ~ To ~ (Step ~)Next
Syntax:
For
:
<expression 1>
2
<control variable name>
:
To
:
<expression 2> [Step
:
<expression 3>]
[<statement>] …
Next
<expression 1> is the initial value, <expression 2> is the end value, and <expression 3> is
the step.
Function
Anything between the
For
command and the
Next
command is repeated for a count starting
with the initial value of the control variable and ending when the control variable reaches the
end value. Each pass causes the value of the control variable to be changed by the value
specified by the step value. The loop is terminated whenever the control variable value
exceeds the end value.
De
s
cription
• 1 is used for the step if a step value is not specified.
• The initial value can be less than the end value, as long as a positive value is specified for
the step. In this case, the value of the control value is increased by the step with each pass.
• The initial value can be greater than the end value, as long as a negative value is specified
for the step. In this case, the value of the control value is decreased by the step with each
pass.
• You can use a multi-statement command (:) in place of the carriage return to separate
statements.
• It is always a bad idea to use the
Goto
command to exit a
For~Next
loop. Not only is it
poor programming, it can cause problems due to improper termination of internal processes
used by the loop operation.
Goto~Lbl
Syntax:
Goto
:
<label name>
Lbl
:
<label name>
Function:
This command causes program execution to jump to a specific location.
De
s
cription
• <label name> is a text string that is subject to the same rules as variable names.
•
Goto
and
Lbl
are used in pairs. Program execution jumps from
Goto
to the
Lbl
with the
same label name. A single
Lbl
can be used as the jump destination of multiple
Goto
commands.
• This command can be used to loop back to the beginning of a program or to jump to any
location within the program.
• An error occurs if ClassPad is unable to find a
Lbl
with the same label as
Goto
.
• Note that the
#
command cannot be used in a label name.
12-6-10
Program Command Reference
Summary of Contents for ClassPad 330
Page 11: ...20060301 20090601 ClassPad 330 ClassPad OS Version 3 04 ...
Page 277: ...20060301 3 3 10 Storing Functions 3 Tap AND Plot OR Plot ...
Page 779: ...20090601 S Graph Line Clustered C S Graph Line Stacked E 13 9 2 Graphing ...
Page 780: ...20090601 S Graph Line 100 Stacked F S Graph Column Clustered G 13 9 3 Graphing ...
Page 781: ...20090601 S Graph Column Stacked I S Graph Column 100 Stacked J 13 9 4 Graphing ...
Page 782: ...20090601 S Graph Bar Clustered K S Graph Bar Stacked 9 13 9 5 Graphing ...