Conditional Branching; Jump Commands; Mainroutine And Subroutine - HP 9g - Graphing Calculator User Manual

Graphing calculator
Hide thumbs Also See for 9g - Graphing Calculator:
Table of Contents

Advertisement

Available languages

Available languages

INPUT memory variable
⇒ Makes the program pause for data input. memory variable =
appears on the display. Enter a value and press [
assigned to the specified variable, and the program resumes execution.
To input more than one memory variable, separate them with a
semicolon (;).
PRINT " text " , memory variable
⇒ Print the text specified inside the double quotation marks and the
value of the specified memory variable.

Conditional branching

IF
( condition
⇒ IF the condition is true, THEN statement is executed.
IF (
condition
⇒ IF the condition is true, the specified THEN statement is executed,
otherwise the ELSE statement is executed.

Jump commands

Lbl n
⇒ An Lbl n command marks a destination point for a GOTO n jump
command. Each label name (Lbl) must be unique (that is, not repeated in
the same program area). The label suffix n must be an integer from 0 to
9.
GOTO n
⇒ When program execution encounters a GOTO n statement, execution
jumps to Lbl n (where n is the same value as the n in the GOTO n
statement).

Mainroutine and Subroutine

GOSUB PROG n ;
⇒ You can jump between program areas, so that the resulting execution
is made up of code from different program areas. The program from
which other program areas are jumped to is the mainroutine, and an
area jumped to is a subroutine. To cause a jump to a subroutine, enter
PROG n where n is the number of the destination program area.
Note: The GOTO n command does not allow jumps between program
areas. A GOTO n command only jumps to the corresponding label (Lbl)
within the same program area.
End
) THEN
{ statement }
) THEN {
statement
}; ELSE {
statement
E-27
]. The value is
}

Advertisement

Table of Contents
loading

This manual is also suitable for:

F2222a#aba - 9s scientific calculator

Table of Contents