HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
3- 9
300 REM This is a remark.
400 !This comment follows an empty statement.
500 PRINT "Hello" !This comment is part of an executable program line.
HP Business BASIC/XL lists a remark with one blank between the keyword
REM and the text of the remark, as in line 300 above. HP Business
BASIC/XL lists a comment with one space before the exclamation point, as
in line 400 above. A comment cannot follow a HELP command.
Program Structure
A program is a sequence of program lines. It is good programming
practice to end a program with an END statement and use STOP statements
within the program if the program must be stopped before it ends.
However, the END statement can appear more than once in a program, and it
need not be the last line.
Syntax
program_line
[
program_line
]...[
END
] [
program_line
]...
Parameters
program_line
Any statement except a command (that is, any statement
with a line number).
The order that program lines are executed in is determined by line
numbers and control statements. Program lines are executed in line
number order unless control statements specify otherwise. Control
statements are in chapter 4.
The lines of a program can be entered in any order. HP Business BASIC/XL
arranges them in line number order before listing them or executing the
program. Chapter 2 explains how to enter program lines.
A program can be divided into program units, one main program and one or
more subunits. Execution begins with the first line of the main program
unit. Subunits are covered later in this chapter.
Variables
In HP Business BASIC/XL, a variable can be numeric or string, scalar or
array, local parameter, or common. This section explains declaring and
using variables.
Certain characteristics of variables can be changed in a program unit.
The OPTION and GLOBAL OPTION statements can change the following program
unit characteristics:
* Default numeric type.
* Initialization of numeric variables to zero.
* Implicit variable declaration.
* Default lower bound of arrays.
* Trace statement output control.