Casio FX-7400G User Manual page 141

Hide thumbs Also See for FX-7400G:
Table of Contents

Advertisement

For~To~Next
Function: This command repeats everything between the For-statement and the
Next-statement. The starting value is assigned to the control variable with the first
execution, and the value of the control variable is incremented by one with each
execution. Execution continues until the value of the control variable exceeds the
ending value.
Syntax:
For <starting value> " <control variable name> To <ending value>
_
<statement>
:
^
Parameters:
• control variable name: A to Z
• starting value: value or expression that produces a value (i.e. sin
• ending value: value or expression that produces a value (i.e. sin
Description:
1. When the starting value of the control variable is greater than the ending value,
execution continues from the statement following Next, without executing the state-
ments between For and Next.
2. A For-statement must always have a corresponding Next-statement, and the Next-
statement must always come after its corresponding For-statement.
3. The Next-statement defines the end of the loop created by For~Next, and so it
must always be included. Failure to do so results in an error (Syn ERROR).
Example: For 1 " A To 10_
A ! 3 " B_
B ^
Next
For~To~Step~Next
Function: This command repeats everything between the For-statement and the
Next-statement. The starting value is assigned to the control variable with the first
execution, and the value of the control variable is changed according to the step
value with each execution. Execution continues until the value of the control variable
exceeds the ending value.
Syntax:
For <starting value> " <control variable name> To <ending value> Step <step value>
Next
Parameters:
• control variable name: A to Z
• starting value: value or expression that produces a value (i.e. sin
• ending value: value or expression that produces a value (i.e. sin
• step value: numeric value (omitting this value sets the step to 1)
Programming
Next
Chapter 8
_
:
^
x
, A, etc.)
x
, A, etc.)
_
:
^
x
, A, etc.)
x
, A, etc.)
138

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents