Naming Conventions

As programs have become more complex both in terms of size and proliferation of data types, many programmers have adopted a variable-naming convention, which is commonly referred to as Hungarian notation. It was Hungarian born programmer Dr. Charles Simonyi (a Chief Architect for Microsoft) who first developed a variable-naming convention. The title is derived from the ironic fact that using his notation can actually make code appear more complex i.e. the joke is that it might as well be written in Hungarian.

Over the years, several “standard” versions of Hungarian notation have been proposed and/or published. The version documented below is an amalgamation of many sources and is designed specifically for KiXtart and KiXforms.

When using Hungarian notation, variable names begin with one or more lowercase letters that denote the variable type, thus providing an inherent identification. For example, the prefix 's' is used to identify a string, as in 'sName' or 'sAddress'. In a similar fashion, the prefix 'al' identifies an array of long integers. The actual variable name is denoted by a leading capital letter.

KiXtart Hungarian Notation

Data Type Definition Prefix Example
Array** Collection of data a abFlag
Boolean True or false b bStatus
Char* 8-bit data item c cInitial
Double 64-bit floating point d dPercent
Function Definable procedure fn fnExit
Global** Scope of variable g glVersion
Long 32-bit integer l lAge
String Array of Characters s sName
* The Char data type does not really exist in KiXtart, but the 'c' prefix can be used to denote a variable that should not contain more than a single character, and in the event that it does, only the first character of the string is considered.
** Denotes a prefix to a data type e.g. asNames is an array of strings. Please note that when a global array is defined, the prefix used is 'ga' and not 'ag'.

KiXforms Hungarian Notation

Object Type Prefix Example
chk chkReadOnly
cbo cboEnglish
cmd cmdExit
frm frmEntry
fra fraLanguage
hyp hypKiXforms
img imgIcon
ils ilsAllIcons
lbl lblHelpMessage
lst lstPolicyCodes
lvw lvwHeadings
opt optGender
pic picVGA
prg prgLoadFile
rtf rtfReport
hsb
vsb
hsbVolume
vsbRate
sld sldScale
spn spnPages
txt txtLastName
tmr tmrAlarm
cmd cmdOnOff