Rules and Naming Conventions

#### Search Results

Search

# Rules and Naming Conventions

This section describes Natural-specific rules and naming conventions.

- Object Naming Conventions

- Library Naming Conventions

- Naming Conventions for User-Defined Variables

## Object Naming Conventions

This section describes the naming conventions that apply when saving and/or cataloging a Natural object in a Natural system file.

The name of a Natural object can be 1 to 8 characters (listed in the following table) where the first character must be one of the following:

- an upper-case alphabetical character

- a number sign (#)

- a plus sign (+)

If the first character is a number sign (#) or a plus sign (+), the name must consist of at least one additional character.

#### Exception:

The name of a Natural DDM can be 1 to 32 characters (listed in the following table) where the first character must be an upper-case alphabetical character.

The name of a Natural object can consist of the following characters:

Character | ISO Character Name | Remark
--- | --- | ---
A - Z | Latin capital letter A - Z | Upper-case alphabetical character
0 - 9 | Digit zero - digit nine | Numeric character
- | Hyphen-minus | Hyphen
_ | Low line | Underscore
/ | Solidus | Slash
@ | Commercial at |
$ | Dollar sign |
& | Ampersand | Only allowed in language codes See also Defining the Language of a Natural Object in the Programming Guide.
# | Number sign | Hash sign
+ | Plus sign |

## Library Naming Conventions

This section describes the naming conventions that apply to a Natural library.

The name (ID) of a library can be 1 to 8 characters and must not start with "SYS". The prefix "SYS" is reserved for Natural system libraries.

A library name must start with an upper-case alphabetical character.

A library name should not end with an underscore.

A library name can consist of the following characters:

Character | ISO Character Name | Remark
--- | --- | ---
A - Z | Latin capital letter A - Z | Upper-case alphabetical character
0 - 9 | Digit zero - digit nine | Numeric character
- | Hyphen-minus | Hyphen
_ | Low line | Underscore

## Naming Conventions for User-Defined Variables

This section describes the naming conventions that apply to a user-defined variable:

- Length of Variable Names

- Limitations of Variable Names

- Characters Allowed in Variable Names

- First Character of Variable Names

- Case of Characters in Variable Names

For further information on user-defined variables, refer to the section User-Defined Variables in the Programming Guide.

### Length of Variable Names

The name of a user-defined variable can be 1 to 32 characters long.

You can use variable names of over 32 characters (for example, in complex applications where longer meaningful variable names enhance the readability of programs); however, only the first 32 characters are significant and must therefore be unique, the remaining characters will be ignored by Natural.

### Limitations of Variable Names

The name of a user-defined variable must not be a Natural reserved keyword.

Within one Natural program, you must not use the same name for a user-defined variable and a database field, because this might lead to referencing errors (see Qualifying Data Structures in the Programming Guide).

### Characters Allowed in Variable Names

The name of a user-defined variable can consist of the following characters:

Character | ISO Character Name | Remark
--- | --- | ---
A - Z | Latin capital and/or small letter A - Z | Upper-case and/or lower-case alphabetical character Lower-case not allowed as the first character
0 - 9 | Digit zero - digit nine | Numeric character
- | Hyphen-minus | Hyphen
_ | Low line | Underscore
/ | Solidus | Slash
@ | Commercial at |
$ | Dollar sign |
& | Ampersand |
# | Number sign | Hash sign
+ | Plus sign | Only allowed as the first character

### First Character of Variable Names

The first character of the name must be one of the following:

Character | ISO Character Name | Remark
--- | --- | ---
A - Z | Latin capital letter A - Z | Upper-case alphabetical character
& | Ampersand |
# | Number sign | Hash sign
+ | Plus sign |

If the first character is a number sign (#), a plus sign (+) or an ampersand (&), the name must consist of at least one additional character.

Variables in a global data area (GDA) with a plus sign (+) as the first character must be defined at Level 1; see also Global Data Area in the Programming Guide. Other levels are only used in a redefinition.

A plus sign (+) as the first character of a name is only allowed for application-independent variables (AIVs) and variables in a global data area (GDA).

Names of AIVs must begin with a plus sign (+); see also Defining Application-Independent Variables in the description of the `DEFINE DATA` statement in the Statements documentation.

An ampersand (&) as the first character of a name is used in conjunction with dynamic source program modification (see the `RUN` statement in the Statements documentation), and as a dynamically replaceable character when defining processing rules; see the relevant description in the Map Editor documentation.

### Case of Characters in Variable Names

With Natural for Windows and Linux, lower-case characters entered as part of a variable name are internally converted to upper case.

Caution
If you use lower-case characters as part of the variable name, variable names must be unique regardless of their case.

### On this page

- Object Naming Conventions
- Library Naming Conventions
- Naming Conventions for User-Defined Variables