Language Elements and Reference:xpplrm

Identifiers Foundation

An identifier is a symbolic name for a variable, function, procedure, class or method which is not further syntactically analyzed by the Xbase++ compiler. Variables are used in a program to access or change values. Functions, procedures and methods designate a separate segment of program code which is executed using an identifier.

An identifier starts with an alphabetic character and is made up of alphanumeric characters. The only special character allowed is the underscore (_). Examples of valid identifiers are shown in the following code:

nNumber1  = 100 
nNumber2  =   2 

nResult   = Divide( nNumber1, nNumber2 ) 

FUNCTION Divide( x, y ) 
  RETURN IIf( y=0, 0, x/y ) 

The compiler does not distinguish between upper and lower case letters in identifiers. The first 255 characters of an identifier are significant. The following table shows valid and invalid identifiers:

Identifiers in Xbase++
Valid Invalid
_nNumber_1 _nNumber 1
cFirstName 1stName
aFiles aFiles#
Show_It Show.It

Identifiers for items held in memory only are significant up to a length of 255 characters. This includes memory variables, functions, procedures, classes and methods. Field variables, whose values are stored in a file, are the exception. The significant length of identifiers for field variables depends on the file format in which the values of the field variables are stored. In other words, the number of significant characters depends on the DatabaseEngine (DBE) used to manage the file. For the DBFNTX DatabaseEngine, only the first ten characters of an identifier are significant for a field variable.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.