Primary Syntax Elements

Directives

 

Directives are commands that instruct the system to perform a task. A directive is the first keyword in a valid program statement. There may be more than one directive in a statement.

Below is a list of some commonly used directives. For a list of all directives, see Directives.

BEGIN

Re-initialize current session; close files, clear all non-global variables, release memory to the system. See CLEAR and RESET directives.

BYE

Terminate session; close all opened files, return memory to the operating system and terminate PxPlus. See QUIT and RELEASE directives.

CWDIR

Change working directory.

DELETE

Remove lines from program or if no lines specified, unload program.

DUMP

Print all variables in use (including ERR system variable), program name, line number, and the FOR..NEXT/ GOSUB stack.

EDIT

Change an existing statement.

END

Terminate execution of program (functionally identical to STOP directive).

GOSUB

Transfer control to line referenced.

INPUT

Issue prompt and process response.

LET

Assign value to a variable.

LIST

Convert program statements to readable format and output to display or file.

LOAD

Read a program into memory for execution, listing, or modification.

MSGBOX

Display a message window in the middle of the screen.

PRINT

Send information to display or a file (if file number specified).

RUN

Start or continue execution of a program.

SAVE

Copy current program to file specified.

START

Reset files and variables (including global files and variables).

Examples

The PRINT directive (or ? shortcut) displays a string literal at the console (with output positioning determined via the @ function):

print "HELLO WORLD"
? @(10,10),"HELLO WORLD"

The LET directive assigns values to a string variable and a global string variable:

let X$="HELLO"
let %X$="JELLO"

The LOAD and the LIST directives are used to view a program (options for the LIST directive include listing a range and displaying with indentation):

load "**" *1
list
list 5100,5220 *2
list edit 5100,5220 *3

The DELETE directive removes lines from a program:

delete 5100,5220 *4

The DELETE directive removes the program from memory:

delete

The RUN directive loads and runs a program (the END directive halts execution):

run "**
stop execution <ctrl+break>
end