CitectVBA Programming Reference > Understanding CitectVBA Language Basics > Naming


Function, subroutine, variable, constant, and label naming in CitectVBA must begin with a letter, be no longer than 40 characters, and cannot be a reserved word. Names can only contain the letters 'A' to 'Z' and 'a' to 'z', the underscore '_' character, and the digits '0' to '9'. Names cannot contain the space character. You cannot use the name of a CitectVBA predefined function as a name. For a list of predefined functions, see CitectVBA Function Reference.

Function, subroutine, variable, constant, and label object names (once declared), become a keyword in CitectVBA. Like most keywords in CitectVBA, these names are not case sensitive. For example, all of the following examples are treated identically in CitectVBA:

pump234.addpoint(25, 100)
Pump234.AddPoint(25, 100)
PUMP234.ADDPOINT(25, 100)

When naming in CitectVBA, make the name an appropriately descriptive term that is easily recognizable. For example:

X.addpoint(25, 100)

doesn't make as much sense as:

Pump234.AddPoint(25, 100)

Combining upper- and lowercase letters between words in the name is an acceptable common programming practice, and aids in readability.

Identically named objects cannot be declared more than once per CitectSCADA project, even though they may exist in different CitectVBA code file modules. However, if an object declared locally within a procedure has the same name as an object declared in a module, CitectVBA will reference the local procedure scope object instead of the modular scope object.

See Also

Scope of CitectVBA

CitectVBA Files

Accessing Cicode Tags with CitectVBA