HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)

2-: 32
Parameters
fname
The name of the disk file containing the program to be
retrieved and executed. This program replaces the
program that is in the interpreter when the RUN command
is issued. The current program in the interpreter's
workspace is executed if
fname
is not specified. If
fname
specifies a nonexistent file, an error occurs, and
the current program is not overwritten.
line_id
The line number or line label in the main program at
which to begin execution. The default is the first
program line. If
line_id
is a line number that is not
in the program, execution begins at the line with the
next higher line number.
str_expr
Assigns the value, a string, to be returned by a call to
the INFO$ function. (See chapter 5).
The RUN command retrieves a disk file the way that the GET statement
does, except that the RUN command removes all common declarations; the
GET statement does not.
Before executing the program, the RUN command allocates space for
variables, initializes them, and resets the following parameters in the
interpreter:
Program execution Stopped
Numeric output format Standard
DEFAULT OFF
Random number seed PI/180
ERRL 0
ERRN 0
BREAK Enabled
Automatic line numbering Off
Options Options specified in configuration file
Note that the RUN, HOP, and STEP commands stop any program that is
executing when the command is entered. Then program execution begins as
specified.
Example
RUN !Runs the current program
RUN "File1" !Runs program File1
RUN "File2";200 !Runs program File2, execution begins at line 200
RUN "File3",200 !Runs program File3, execution begins at line 200
RUN;1200 !Runs the current program, execution begins at
!line 1200
RUN;INFO="TEST CODE" !Runs the current program, the INFO$ function
!returns TEST CODE
RUN "File1"; INFO="Name" !Runs program File1, the INFO$ function
!returns Name
RUN "File2";200;INFO="1985" !Runs File2, execution begins at line 200,
!the INFO$ function returns 1985
RUN "File3",200;INFO="West" !Runs File3, execution begins at line 200,
!the INFO$ function returns WEST
RUN;1200;INFO="yellow" !Runs the current program, execution begins
!at line 1200, the INFO$ function
!returns yellow