HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
4- 64
125 PRINT "NOT OK"
130 GOSUB Error-routine !Control transfers to Error-routine
135 END IF
IF THEN ELSE constructs can be nested; that is, the IF or ELSE clause of
one IF THEN ELSE structure can contain another IF THEN ELSE construct.
The ENDIF is associated with the most recently preceding IF THEN ELSE
construct.
100 IF I THEN !Begin outer construct
110 IF J THEN !Begin inner construct
120 PRINT "I and J are not 0"
130 ELSE !ELSE for inner construct
140 PRINT "J is 0 but I is not"
150 ENDIF !End inner construct
160 ELSE !ELSE for outer construct
170 PRINT "I is 0"
180 ENDIF !End outer construct
The ELSE clause can be omitted.
406 IF Number_left THEN
407 PRINT "There are numbers left"
408 STOP
409 END IF
Control transfer into a THEN or ELSE clause, but this is not a
recommended programming practice.
IMAGE
The IMAGE statement specifies the output format for the output items in
the display list of a DISP USING or PRINT USING statement. If the image
of a DISP USING or PRINT USING statement is a line identifier, the line
identifier must identify an IMAGE statement. Because an IMAGE statement
can end in an unquoted string literal, it cannot be followed by a
comment. The IMAGE statement is not executable.
Syntax
IMAGE
format_string
Parameters
format_string format_string
(if it belongs to an IMAGE statement) or
its value (if
format_string
itself is the image of a
PRINT or DISP statement) has the following syntax:
format_spec
[,
format_spec
]...
[
num_expr
] (
format_spec
[,
format_spec
]...)
format_spec
One of the format specifiers described in "Format
Specifiers" in chapter 6.
num_expr
Repeat factor. Rounded to a short integer,
n
. The
format_string n
(
format_spec_list
) is equivalent to
n
adjacent copies of
format_spec_list
(see examples).
Examples
100 DISP USING 110; A,B,C
200 PRINT USING 210; A,B,C
300 DISP USING 310; P,Q
400 PRINT USING 410;A,R
The IMAGE statements that they reference are: