20060301
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
s
eIf
command expression is tested. If it is true,
the statement in the
El
s
eIf Then
block is executed. After that, execution advances to the
next statement after
IfEnd
. If it is false, the
El
s
e
block statement is executed. After that,
execution advances to the next statement after
IfEnd
.
De
s
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
2
a
If b < 0
Then
0
2
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>
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 ...