Variable Naming Conventions

ATEasy uses prefixes for naming variables in its internal library. While these are not requirements when creating variables, we recommend these conventions be used whenever a variable is declared. Prefixes are based on the variable data type and used to identify the data type without checking how it was defined. This expedites the debug and maintenance process as well as the form coding standard that is important when multiple users are working or debugging the same module.

The recommended format of variables names is shown below:

[scope] [pointer] [array] [Type] VariableBaseName

Where:

        Scope refers to public (g_) or non-public (m_) driver or system variables. Procedure or program variables do not have a scope prefix.

        Pointer refers to VAR parameters or pointers having the p prefix.

        Array indicates the variable is an array by using the a prefix.

        Type is one of the types as follows:

c for Char, n for Short, l, i or j for Long, and dl for DLong (for example, lCount).

uc for Byte, w for Word, dw for DWord, and ddw for DDWord (for example, dwMask).

f for Float, d for Double (for example, dResult).

s for String and bs for BString (for example, sText).

b for Bool, v for Variant, cy for Currency, dt for DateTime, ob for Object, en for Enum, and st for Struct (for examples, bModified, vKey, cyTotalAmount, dtToday...).

        VariableBaseName refers to the name of the variable. This should be one or more words with no spaces or underlines between them. Each word starts with upper case characters and continues with lower case characters (for example, nNumOfSamples)

As an example, the following variable is a public module array. Each element in the array has a type of Double:

g_adSampleResults

Other rules imposed by the ATEasy programming language for naming identifiers must be followed. These rules set the maximum number of characters for a name: 256 characters, the allowed characters for the starting identifier: _, A-Z, a-z, and the allowed characters following the first character A-Z, a-z, 0-9, _.