RUN
Executes a compiled DataBasic program.
Note
To run a program under debug, use the DEBUG command instead of RUN.
Syntax
RUN file-specifier item-id {(options}
Syntax elements
file-specifier The name of the file containing the program.
item-id The name of the item containing the source code (the name of the DataBasic program to run).
Options
F Treats warning messages as fatal errors. When a warning message occurs, RUN breaks to the DataBasic debugger to allow determination of error and possible recovery. You can continue program execution with the G command or by pressing line feed (ctrl+j).
I Inhibits initialization of data areas that are common to two DataBasic programs. The I option is valid only when the RUN command is used in a CHAIN statement.
N No page. Does not wait for a carriage return after each page is output to the terminal.
P Sends output to the printer.
S Suppresses run-time warning messages.
T Inhibits writing of tape label when using the WRITET statement.
Note
These options are intercepted and actioned by RUN before being passed on to the executed program; this is also the case if a cataloged program is executed directly. Using these options in your program may give unexpected results.
Comments
If an executable (platform-specific) item exists in the dictionary of the specified file, RUN will execute this item rather than any deliverable (platform-independent) item in the data section. For details of the different types of item generated by the compiler, refer to the description of the BASIC command.
It is recommended that, rather than using RUN, you should catalog your programs. This has several advantages - refer to the description of theCATALOG command for details. The options described above also apply to cataloged programs.
Run-time errors
If a run-time error occurs, an appropriate warning/error message is displayed. Fatal run-time errors cause the program to exit to the DataBasic symbolic debugger.
The warning/error message includes the program line number where the error occurred; for example:
[B10] Program MYPROG Line 10, [6]: Unassigned variable; zero used.
In the above, the first line number (10) gives the program line number, taking account of any included items, while the second, in brackets (6), gives the actual line in the named source item (MYPROG).
If an error occurs in an included item, the line number within that item is also given; for example:
[B10] Program MYPROG Line 7, [4]+3: Unassigned variable; zero used.
In the above, the error occurred in program line 7, which was in fact at line 3 of the item included at line 4 of the named source item.
Note
Nested includes are treated as a single included item; that is, the line number given is an offset from the original INCLUDE statement.
For a complete program listing, taking account of any included items, use either of the following:
-
The BLIST command with the M and E options; for example:
BLIST PROGRAMS MYPROG (ME
-
The L* debugger command. You can run your program with the F option to force it to enter the debugger when a warning occurs.
Example
RUN PROGRAMS TESTING
Executes the program TESTING.