# Directives

> Source: https://manual.pvxplus.com/pxplus-user-guide/language-elements/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](https://manual.pvxplus.com/directives)**.

|  |  |
| --- | --- |
| **[BEGIN](https://manual.pvxplus.com/directives/begin)** | Re-initialize current session; close files, clear all non-global variables, release memory to the system. See **[CLEAR](https://manual.pvxplus.com/directives/clear)** and **[RESET](https://manual.pvxplus.com/directives/reset)** directives. |
| **[BYE](https://manual.pvxplus.com/directives/bye)** | Terminate session; close all opened files, return memory to the operating system and terminate PxPlus. See **[QUIT](https://manual.pvxplus.com/directives/quit)** and **[RELEASE](https://manual.pvxplus.com/directives/release)** directives. |
| **[CWDIR](https://manual.pvxplus.com/directives/cwdir)** | Change working directory. |
| **[DELETE](https://manual.pvxplus.com/directives/delete)** | Remove lines from program or if no lines specified, unload program. |
| **[DUMP](https://manual.pvxplus.com/directives/dump)** | Print all variables in use (including **[ERR](https://manual.pvxplus.com/variables/err)** system variable), program name, line number, and the **[FOR..NEXT](https://manual.pvxplus.com/directives/for)**/ **[GOSUB](https://manual.pvxplus.com/directives/gosub)** stack. |
| **[EDIT](https://manual.pvxplus.com/directives/edit)** | Change an existing statement. |
| **[END](https://manual.pvxplus.com/directives/end)** | Terminate execution of program (functionally identical to **[STOP](https://manual.pvxplus.com/directives/stop)** directive). |
| **[GOSUB](https://manual.pvxplus.com/directives/gosub)** | Transfer control to line referenced. |
| **[INPUT](https://manual.pvxplus.com/directives/input)** | Issue prompt and process response. |
| **[LET](https://manual.pvxplus.com/directives/let)** | Assign value to a variable. |
| **[LIST](https://manual.pvxplus.com/directives/list)** | Convert program statements to readable format and output to display or file. |
| **[LOAD](https://manual.pvxplus.com/directives/load)** | Read a program into memory for execution, listing, or modification. |
| **[MSGBOX](https://manual.pvxplus.com/directives/msgbox)** | Display a message window in the middle of the screen. |
| **[PRINT](https://manual.pvxplus.com/directives/print)** | Send information to display or a file (if file number specified). |
| **[RUN](https://manual.pvxplus.com/directives/run)** | Start or continue execution of a program. |
| **[SAVE](https://manual.pvxplus.com/directives/save)** | Copy current program to file specified. |
| **[START](https://manual.pvxplus.com/directives/start)** | Reset files and variables (including global files and variables). |

## Examples

The **[PRINT](https://manual.pvxplus.com/directives/print)** directive (or **?** shortcut) displays a string literal at the console (with output positioning determined via the **[@](https://manual.pvxplus.com/functions/at)** function):

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

The **[LET](https://manual.pvxplus.com/directives/let)** directive assigns values to a string variable and a global string variable:

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

The **[LOAD](https://manual.pvxplus.com/directives/load)** and the **[LIST](https://manual.pvxplus.com/directives/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](https://manual.pvxplus.com/directives/delete)** directive removes lines from a program:

```
delete 5100,5220 *4
```

The **DELETE** directive removes the program from memory:

delete

The **[RUN](https://manual.pvxplus.com/directives/run)** directive loads and runs a program (the **[END](https://manual.pvxplus.com/directives/end)** directive halts execution):

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