Variable naming is similar to Identifier - begin with an underscore (_) or an alphabetic character, and can be followed by any combination of alphabetic characters, numeric characters or underscore (_). Use this topic as guidelines to name a variable. ATEasy uses the following prefixes for naming internal (variables, user-defined) data types. The prefix naming convention is recommended for your use when you declare variables. Variables name prefix can be set automatically from the variable type and vise versa by activating the Type-Prefix options in the Variables Options page. When active, you can type the variable name with a prefix and the type will be set accordingly. For example name a variable as sData will set the variable name to String.
Data Type |
Recommended Prefix |
Example |
AColor |
clr |
clrRed |
Afont |
font |
fontBold |
AHandle |
h |
hDriverDMM |
Any |
p |
pVar |
APicture |
pic |
picButtonOff |
APixel |
x, y, cx, cy |
xTopLeft |
Bool |
b |
bOkay |
BString |
s or bs |
sText |
Byte |
uc |
ucDataByte |
Char |
c |
cChar |
Currency |
cur |
curTotalSales |
DateTime |
dtm |
dtmStartDate |
Double |
d |
dMininum |
DWord |
dw |
dwData |
DDWord |
ddw |
ddwData |
Enum type |
enum |
enumAAxisType |
Enum member |
axxx |
aaxsTypeXAxis |
Enum variable |
en |
enBorderStyle |
Float |
f |
fButtonHeight |
Long |
l (letter "L") |
lCount |
DLong |
dl |
dlSize |
Object |
ob |
obButtonOnOff |
Procedure |
proc |
procCallBack |
Short |
n |
nCount |
String |
s |
sText |
Structure |
st |
stData |
Variant |
v |
vParam |
Variant(Bool) |
vb |
vbOkay |
Variant(BString) |
vs |
vsButtonName |
Variant(integer number) |
vi |
viParam |
WChar |
wc |
wcLast |
Word |
w |
wIndex |
The following table lists the Type Modifier data types and the recommended prefix to use when you declare a Type Modifier as a variable. This data type is considered a Type Modifier because its basic data type is changed by adding a Type Modifier prefix before the data type prefix. You must add the Type Modifier prefix before the data type prefix.
Data Type: Type Modifier |
Recommended Prefix before the Data Type Prefix |
Example |
Array |
a |
alMatrix |
Global (for public variables in Drivers or System) |
g_ |
g_IStatus |
Member (for private variables in Drivers or System, may also be used for program to differentiate from procedure variables) |
m_ |
m_nHandle |
Form Variables |
f_ |
f_bModified |
Pointer or Var parameters |
p |
pbCancel |