Normal Program Execution - HP 9000 200 Series Manual

Using the basic 5.0/5.1 system
Table of Contents

Advertisement

Normal Program Execution
The term "program
execution~:
is used to describe the process of the BASIC system
completing the tasks "described" by a program. The steps that the system performs
during program execution are summarized below.
1. Determine which program line is to be acted on next.
2. Identify the statement that follows the line number and label (if any) on that line.
3. If the statement has a run-time action. perform the action described in the
statement.
4. Repeat steps 1 through 4 until instructed to pause or stop (such as by an END,
STOP, or PAUSE
statement~
or hy a
I
RESET
I
from the kpyhoard).
The continuing process of determining which line is to be executed next is discussed
in detail in the chapter called "Program Flow" ill BASIC Programming Techniques.
The RUN command determines which line is acted on first.
Executing
RUN
with no
parameters~
or pressing the
I
RUN
I
key, causes the execution process to begin at the first
(lowest-numbered) line of the main program. Execution can be started anywhere in
the main program by using the RUN command with a line identifier. For example, the
following command causes execution to begin at line 220. if there is such a line.
RUN 220
If there is no line 220 in the main program, execution begins with the line whose number
is closest to and greater than 220.
ThE' lin£' id£'ntifiE'r can also h£' a lah£'l.
For example. th£' following command causes
execution to begin with the line labeled "SpoLrun".
If there is no such labeL an error results.
Also. if a
~tartillg
line is specifipd. that lin(' mllst bE' in tIl{' main program. An error 3 (line
not found in current context) results if you attempt to start a program ill a user-detiued
function or subprogram. Even if the starting point is correctly specified. be alert to the
effects of starting a program in the middle. Skipping ovpr a section of thE' program may
result in null values for some of the variables. Although it is legal to start in the middle
of a subroutine. an error is generated when the RETURN statement is executed.
4-8
Loading and Running Programs

Advertisement

Table of Contents
loading

This manual is also suitable for:

9000 300 series

Table of Contents