Conventions

Zurück Home
 

 

These convention are valid for modules version 2.08 and above.

Variables und Modules

Class names: cClass
Module names: vbxFunction (File name without prefix) or mod...

Prefix for the availability of variables
g Global    e.g. gintCount
m Class level (Member)    e.g. mstrTitle
p Private module variables (use is not recommended)    Bsp. plngLength
c Constants    e.g. cintShowMessage


Prefix for the data type of variables
var Variant
bol Boolean
byt Byte
int Integer
lng Long
sng Single
dbl Double
cur Currency
dat Date / Time
str String
obj Object
col Collection
tag (udt) User defined Structure                   

Short names are allowed in procedures:
x, y, z, i - Loop count
p, p1-pN - Position pointer
tmp - temporary varibale (For Each tmp In ...) usually Variant

Global objects, which are often used may have short names, but their number should be limited.
    e.g. ini, fso

The declaration of global variables should be avoided when possible. The use of a global base class with all Settings, which are needed on global level, is recommended instead. Thus explicit names without prefix can be used, without the fear of naming conflicts.

Procedure variables don't have a prefix for the availability.
    e.g. Dim objFolder As Folder

Numeric constants are added to enumeration when they serve the same scope, in order to simplify the selection of arguments and return values (Intellisense).

API constants, function arguments and structure variables are named according to the original documentation. Constants are summarized in Type structures and should be declared local.
    e.g.
    Private Type SHFILEOPSTRUCT
        hWnd As Long
        wFunc As Long
        pFrom As String
        pTo As String
        fFlags As Integer
        fAnyOperationsAborted As Long
        hNameMappings As Long
        lpszProgressTitle As String
    End Type

API functions are provided enclosed in general valid modules and with a VB suited interface and error handling.

Using the modules / Version compatibility

General valid modules (VBX modules) are in itself enclosed modules, making a certain functionality available.
The modules do not need global variables or objects with exception of fso. Dependences to other modules are avoided.

These modules are shared. Changes, impairing the version compatibility are made only if really necessary and will be explicitly added to the version history. Copies of modules should be avoided. In order to avoid version conflicts and to ensure however a certain flexibility, options should be preferably stored and passed with additives flags. Extensions of methods should be made by reflection, whereby a upper case letter is added to the procedure name or an abbreviation of the extension:
    e.g. Item -> ItemA or ItemNr

The minimum requirement for all tests is Win98SE or Win2k with IE5.

     


© 2002-2007 VBX System