Casio CLASSPAD 330 3.04 User Manual page 668

Classpad os version 3.04
Table of Contents

Advertisement

Syntax 4: If
<expression>
Then
[<statement>] ...
ElseIf
<expression>
Then
[<statement>] ...
Else
[<statement>] ...
IfEnd
Function 4
• If the expression is true, the statement in the If Then block is executed. After that, execution
advances to the next statement after IfEnd.
• If the If command expression is false, the El eIf command expression is tested. If it is true,
the statement in the El eIf Then block is executed. After that, execution advances to the
next statement after IfEnd. If it is false, the El e block statement is executed. After that,
execution advances to the next statement after IfEnd.
De cription
• With all four of the syntaxes described above, you can use a multi-statement command (:)
in place of the carriage return to separate Then block statements.
• The If~IfEnd command can be nested.
Example: Input a
Input b
If a < 0
Then
0
a
If b < 0
Then
0
b
IfEnd
IfEnd
• The If~IfEnd loop can be exited using the Break command or Return command.
• It is always a bad idea to use the Goto command to exit an If~IfEnd loop. Not only is it
poor programming, it can cause problems due to improper termination of internal processes
used by If.
12-6-12
Program Command Reference
}
If Then <block>
}
ElseIf Then <block>
}
Else <block>
20060301

Advertisement

Table of Contents
loading

This manual is also suitable for:

Classpad 330

Table of Contents