RUN

RUN

Top  Previous  Next

 

The RUN command initiates execution of a compiled QMBasic program. It can also be used to execute VOC style items that are stored in alternative files.

 

 

Format

 

RUN {file.name} record.name {LPTR} {NO.PAGE}

 

where

 

file.nameis the name of the directory file holding the program or VOC style item to be run. If omitted, this defaults to BP. The .OUT suffix for the compiler output file is supplied automatically when using the command to execute a QMBasic program.

 

record.nameis the name of the compiled program or VOC entry.

 

LPTRcauses output to logical print unit 0 to be directed to the printer. This is identical in effect to a PRINTER ON statement being performed within the program.

 

NO.PAGEsuppresses pagination of output to the terminal.

 

 

The rules regarding location of the item to be executed are:

 

1.If only one name is provided, BP is assumed as the file name.

 

2.If a file with the .OUT suffix added to the name is defined in the VOC and can be opened, record.name is assumed to be the name of a compiled QMBasic program. The RUN command can also be used to run an object instantiated from a class module that contains a public subroutine named MAIN.

 

3.If the file is not defined in the VOC or cannot be opened for any reason, record.name is assumed to be the name of a VOC style item (sentence, paragraph, menu, etc) in the named file without the .OUT suffix.

 

4.If the item identified by the above steps cannot be found, an error is reported.

 

 

By default, output directed to the screen from a program will pause at the end of each page waiting for user confirmation. For compatibility with some other systems, the RUN.NO.PAGE mode of the OPTION command can be enabled such that the pause will not occur. If the PAGINATE.ON.HEADING mode of the OPTION command in also enabled, setting a page heading or footing in the application will cause the page end pause to be enabled. The NO.PAGE keyword to the RUN command will override this such that pagination never occurs. This keyword can also be used when running a catalogued program by entering its name.