Casio fx-5800P Calculator User Manual


 
E-115
Note These commands evaluate the expressions on either side, and return 1 if
true and 0 if false.
A
Jump Commands
Goto ~ Lbl
Syntax Goto
n
: .... : Lbl
n
or Lbl
n
: .... : Goto
n
(
n
is an integer from 0 to 9, or a
variable name from A through Z.)
Function Execution of Goto
n
jumps to corresponding Lbl
n
.
Example ?
A : Lbl 1 : ?
B : A × B ÷ 2
^
Goto 1
Important! A Go ERROR occurs if there is no corresponding Lbl
n
in the same program
where Goto
n
is located.
Dsz (Decrement and Skip on Zero)
Syntax Dsz <variable> : <statement 1> : <statement 2> : ...
Function Decrements the value of <variable> by one. Then if the <variable> value
is non-zero, <statement 1> is executed, followed by <statement 2> and
everything after it in succession. If the <variable> value is zero, <statement
1> is skipped, and <statement 2> and everything after it is executed.
Example 10
A : 0
C : Lbl 1 : ?
B : B + C
C : Dsz A : Goto 1 : C ÷ 10
Isz (Increment and Skip on Zero)
Syntax Isz <variable> : <statement 1> : <statement 2> : ...
Function Increments the value of <variable> by one. Then if the <variable> value
is non-zero, <statement 1> is executed, followed by <statement 2> and
everything after it in succession. If the <variable> value is zero, <statement
1> is skipped, and <statement 2> and everything after it is executed.
S
Syntax
1
<expression> <relational operator> <expression>
S
<statement 1> :
<statement 2> : ...
2
<expression>
S
<statement 1> : <statement 2> : ...
Function This is a conditional branching command. Conditional branching command
used in combination with relational operators (=,
, >,
>
, <,
<
).
Syntax
1
: <statement 1> is executed if the condition to the left of the
S
command is true, and then <statement 2> and everything after it is executed
in sequence. <statement 1> is skipped if the condition to the left of the
S
command is false, and then <statement 2> and everything after it is
executed.
Syntax
2
: A non-zero evaluation result of the condition to the left of the
S
command is interpreted as “true”, so <statement 1> is executed, followed
by <statement 2> and everything after it in succession. A zero evaluation
result of the condition to the left of the
S
command is interpreted as “false”,
so <statement 1> is skipped, and <statement 2> and everything after it is
executed.