# DEF CTL/ERR/LFO/LFA Define System Variables

> Source: https://manual.pvxplus.com/directives/def-ctl-err-lfo-lfa

## Formats

|  |  |
| --- | --- |
| 1\. *Set Contents of CTL Variable:* | **DEF CTL**=*num* |
| 2\. *Set Contents of ERR Variable:* | **DEF ERR**=*num* |
| 3\. *Set Contents of LFO Variable:* | **DEF LFO**=*num* |
| 4\. *Set Contents of LFA Variable:* | **DEF LFA**=*num* |
| 5\. *Set Contents of LPG Variable:* | **DEF LPG**=*str* |
| 6\. *Set Contents of HWD Variable:* | **DEF HWD**=*str* |
| 7\. *Set Contents of NID Variable:* | **DEF NID**=*str* |

***Where:***

|  |  |
| --- | --- |
| *num* | Value for setting selected variable. Numeric expression, integer. |
| *str* | Value for setting selected variable. String. |

## Description

Use these **DEF** formats to define the contents of a specified system variable:

***Numeric Variables:***

|  |  |  |
| --- | --- | --- |
|  | DEF **CTL** | Numeric code (integer) that represents a signal of user input from the keyboard or mouse. |
|  | DEF **ERR** | Numeric value (integer) that indicates the last system-detected error. |
|  | DEF **LFO** | Channel/file number of the last file opened. |
|  | DEF **LFA** | Channel/file number of the last file or device accessed. |

***String Variables:***

|  |  |  |
| --- | --- | --- |
|  | DEF **LPG** | Lead program to run (normally passed in the Command line or START directive). |
|  | DEF **HWD** | Current directory when process started. |
|  | DEF **NID** | Network identifier for the processor running the application. |

*(The DEF CTL/ERR/LFO/LFA directives were added in PxPlus v7.00.)  
(The DEF LPG/HWD directives were added in PxPlus v8.11, build 9182.)  
(The DEF NID directive was added in PxPlus v8.30, build 9190.)*

## See Also

[CTL Control Code: Key to End Input](https://manual.pvxplus.com/variables/ctl)
[ERR Last System-Detected Error Value](https://manual.pvxplus.com/variables/err)
[LFO Last File Number Opened](https://manual.pvxplus.com/variables/lfo)
[LFA Last File Number Accessed](https://manual.pvxplus.com/variables/lfa)
[LPG Lead Program Name](https://manual.pvxplus.com/variables/lpg)
[HWD Starting/Home Directory](https://manual.pvxplus.com/variables/hwd)
[NID Network or Network Node ID](https://manual.pvxplus.com/variables/nid)
