Dim frmNewPub As New frmPublication
Constants are named in uppercase letters, with no type or scope prefixes. Arbitrary prefixes can be used to group sets of related constants:
Const TABLE_SIZE As Integer = 100 Const DEFAULT_LOG_FILE As String = "log.txt" Const ERR_GENERIC As Integer = 32767 Const ERR_LOGON_FAIL As Integer = 32766 Const ERR_COMPONENT_MISSING As Integer = 32765
Type and Class Definitions
Type names are prefixed with t, and class names are prefixed with C. These prefixes are also used as the base-type prefixes when naming instances. The rest of the name is written in mixed case:
Type tTableEntry nNewState As Integer lAction As Long End Type
And in use:
Dim tCell As tTableEntry Dim CSymbolTable As New CTable
Source filenames are restricted to the traditional 8.3 format. The first three characters are reserved for a project identifier, and the default file extensions are retained. The remaining five characters are used to distinguish files in whatever way seems appropriate.
This is an example of a local string:
Dim sCustomerName As String
This is an example of a module-level integer:
Dim nmCustomerId As Integer
Here is a global-level Double defined in the module Mi:
Public dPuMiCustomerNumber As Double
Here is a global-level Double; the module identifier is not defined or else resident in the project-wide globals module.
Public dPuCustomerNumber As Double
This is a global array of Longs. The module identifier is not defined or else resident in the project-wide globals module.
Public alPuAmounts(1 to 25) As Long
This is a global database. The module identifier is Dt:
Public dbPuDtCustomers As Database
This shows a call to an external DLL function; the result is assigned to a global variable resident in the project-wide global's module.
bPuRetCode = bDllIsShareLoaded ()