# DEF Directives

> Source: https://manual.pvxplus.com/directives/def

The **DEF** directive has a variety of formats that allow for the definition of objects, functions, and other system values.

## Formats

Use the links below to access additional information for a ***specific*** format:

| **Format** | **Description** |
| --- | --- |
| [DEF ARG(nn) = string$](https://manual.pvxplus.com/directives/def-arg) | Use the **DEF ARG** to change the value associated with an ARG for the duration of the session. |
| [DEF CLASS class$...](https://manual.pvxplus.com/directives/def-class) | Use the **DEF CLASS** directive in **[Object Oriented Programming](https://manual.pvxplus.com/pxplus-user-guide/object-oriented-pxplus/introduction)** (OOP) to declare the start of an object definition.<br>It defines the name of the object, and it can be used to override object creation and deletion logic. |
| [DEF \[ CTL \| ERR \| LFO \| LFA \] =numval](https://manual.pvxplus.com/directives/def-ctl-err-lfo-lfa) | Use these **DEF** directives to set the values for various system ***numeric*** variables.<br>*(The DEF CTL/ERR/LFO/LFA directives were added in PxPlus v7.00.)* |
| [DEF \[ LPG \| HWD \| NID \] =strval](https://manual.pvxplus.com/directives/def-ctl-err-lfo-lfa) | Use these **DEF** directives to set the values for various system ***string*** variables.<br>*(The DEF LPG/HWD directives were added in PxPlus v8.11, build 9182.)  <br>(The DEF NID directive was added in PxPlus v8.30, build 9190.)* |
| [DEF \[ CVS \| DTE \| LCS \| UCS \] (new_table$)](https://manual.pvxplus.com/directives/def-cvs-dte-lcs-ucs) | Use these **DEF** directives to define new system tables for *Accent Conversion, Date, Lowercase* and *Uppercase*. |
| **[DEF ENV (name$) = value$](https://manual.pvxplus.com/directives/def-env)** | Use the **DEF ENV** directive to add, change or delete environment variables from the current process and any subsequent spawned process.<br>*(The DEF ENV directive was added in PxPlus 2024.)* |
| [DEF FN var$(arglist) ..](https://manual.pvxplus.com/directives/def-fn). | Use the **DEF FN** directive to define single- or multi-line functions. |
| [**DEF GID** =*groupID*   <br>**DEF UID** =*userID*](https://manual.pvxplus.com/directives/def-gid-uid) | Use the **DEF GID=** and **DEF UID =** directives to override the effective UNIX/Linux user or group ID of a session, if OS security allows it. |
| [DEF MSG (msg_text$)](https://manual.pvxplus.com/directives/def-msg) | Use the **DEF MSG** directive allows you to change system messages on the fly. |
| **[DEF NAR =value](https://manual.pvxplus.com/directives/def-nar)** | Use the **DEF NAR** directive to reduce the number of arguments that a program sees.<br>*(The DEF NAR directive was added in PxPlus 2017.)* |
| [DEF OBJECT...](https://manual.pvxplus.com/directives/def-object) | Use the **DEF OBJECT** directive is used to create a new instance of a specified COM object. |
