Identifiers

Identifiers are arbitrary names of any length given to functions, variables, symbolic constants, user-defined data types and labels. All these program elements will be referred to as objects throughout the help (don't be confused with the meaning of object in object-oriented programming).

Identifiers can contain letters from a to z and A to Z, the underscore character “_” and digits from 0 to 9. First character must be a letter or an underscore, i.e. identifier cannot begin with a numeral.

Case Sensitivity

mikroBasic PRO for ARM is not case sensitive, so Sum, sum, and suM are equivalent identifiers.

Uniqueness and Scope

Although identifier names are arbitrary (within the rules stated), errors result if the same name is used for more than one identifier within the same scope. Simply, duplicate names are illegal within the same scope. For more information, refer to Scope and Visibility.

Identifier Examples

Here are some valid identifiers:

temperature_V1
Pressure
no_hit
dat2string
SUM3
_vtext

… and here are some invalid identifiers:

7temp       ' NO -- cannot begin with a numeral
%higher     ' NO -- cannot contain special characters
xor         ' NO -- cannot match reserved word
j23.07.04   ' NO -- cannot contain special characters (dot)
Copyright (c) 2002-2012 mikroElektronika. All rights reserved.
What do you think about this topic ? Send us feedback!
Want more examples and libraries? 
Find them on LibStock - A place for the code