Naming Variables

Navigation:  Appendices > Macro Language > Variables >

Naming Variables

Previous pageReturn to chapter overviewNext page

Macro variables are typed. This means that they are of one of 3 types : Boolean, Integer or String. The way Q++ can tell the type of a variable, is by looking at the first letter of its name.

 

Boolean variables start with a lowercase "b" (eg. bIsLeapYear).

 

Integer or Date variables start with a lowercas "n" (eg. nToday).

 

String variables start with a lowercase "s" (eg. sMonthName).

 

The names you give to your variables should obey the following rules and suggestions :

 

Your variable names may not include any digits (0-9) nor the underscore character "_". These are reserved for temporary and system variables.

 

We recommend using only the following 52 letters : a..z and A..Z. The use of any other letter (such as é, î, æ, å, ø) is strongly discouraged due to different implementations of the diacritical characters in Windows.

 

Note that variable names are case-sensitive. Q++ will treat the variables sMyFamilyName as a distinct variable from sMyFamilyname.

 

We suggest using informative compound names for your variable, and making them more legible by putting the first letter of each word in uppercase (eg. bMondayIsHoliday).


Topic 108183 updated on 01-Nov-2016.
Topic URL: http://www.qppstudio.net/webhelp/index.html?namingvariables.htm