Casio fx-50F User Manual page 69

Casio calculator user's guide fx-50f
Hide thumbs Also See for fx-50F:
Table of Contents

Advertisement

For~To~Next
For {expression (starting value)} → {variable (control variable)} To {expression
Syntax
(ending value)} : {statement} : ... {statement} : Next : ....
Function
Execution of the statements from For to Next repeats as the control variable
is incremented by 1 with each execution, starting from the starting value.
When the value of the control value reaches the ending value, execution
jumps to the statement following Next. Program execution stops if there is no
statement following Next.
For 1 → A To 10 : A
Example
For~To~Step~Next
For {expression (starting value)} → {variable (control variable)} To {expression
Syntax
(ending value)} Step {expression (step)} : {statement} : ... {statement} :
Next : ....
Function
Execution of the statements from For to Next repeats as the control variable
is incremented by the step amount with each execution, starting from the
starting value. Except for that, this command is the same as For~To~Next.
For 1 → A To 10 Step 0.5 : A
Example
A Control Structure Commands/While Statement
While~WhileEnd
Syntax
While {conditional expression} : {statement} : ... {statement} : WhileEnd : ....
Function
The statements from While to WhileEnd are repeated while the conditional
expression following While is true (non-zero). When the conditional
expression following While becomes false (0), the statement following
WhileEnd is executed.
? → A : While A < 10 : A
Example
Note
If the condition of the While statement is false the fi rst time this command is executed,
execution jumps directly to the statement following WhileEnd without executing the
statements from While to WhileEnd even once.
A Program Control Commands
Break
Syntax
.. : {Then ; Else ;
Function
This command forces a break in a For or While loop, and jumps to the next
command. Normally, this command is used inside of a Then statement in
order to apply a Break condition.
? → A : While A > 0 : If A > 2 : Then Break : IfEnd : WhileEnd : A
Example
A Setup Commands
These commands function the same way as the calculator's various setup settings. For
more information, see "Calculator Setup" on page 8.
2
→ B : B
Next
2
→ B : B
2
A+1 → A : WhileEnd : A÷2
} Break : ..
E-68
Next

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fx-50f plus

Table of Contents