Object Types
- Last UpdatedNov 10, 2025
- 2 minute read
Every PML2 variable has an object type which is set when the variable is created and remains fixed as long as the variable exists.
Attempting to store a value of the wrong type in an existing variable will cause an error. The object type must exist before you can create a variable of that type.
PML 2 is supplied with built-in object types, system-defined object types, and you can also define your own user-defined object types.
The built-in object types include the following:
|
Object |
Description |
|---|---|
|
STRING |
This holds any Unicode text, including newline and characters such as Kanji. In macros written with PML1 where variables are created with the VAR command, all variables are of type STRING, even when they are storing numbers |
|
REAL |
This is used for all numeric values including do loop counters. There is no separate integer type. These are often used to store physical quantities (especially distances). The values stored are (nearly) always in the current working units of the quantity (for distances most often mm and inches). To distinguish what units the value is stored in the units are also stored with the value as another member of the REAL object. In addition the type of quantity (its DIMENSION or MEASURE) is also stored. For distances this is Length. The full set of standard dimensions and units supported by the system is described in the database reference manual. These are in addition to compound units and generic dimensions. |
|
BOOLEAN |
This is used for the result of logical expressions and holds the value TRUE or FALSE Note: These are not the same as the STRING values ‘TRUE’ and ‘FALSE’. |
|
ARRAY |
This holds many values of any type and is described in Chapter 6. |
There are also system-defined variable types, such as POSITION and ORIENTATION in Marine.
User-defined variable types are explained in User-defined Object Types.