ðHgeocities.com/Baja/Dunes/7592/vbcc1.htmgeocities.com/Baja/Dunes/7592/vbcc1.htm.delayedxMÔJÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ ‡ÕgOKtext/html° hgÿÿÿÿb‰.HFri, 10 Jul 1998 01:16:15 GMT~Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98)en, *MÔJg Visual Basic Naming Conventions

Visual Basic Naming Conventions

Page 1

Home Page | VB Page | Next Page

Introduction to this document
These naming conventions are provided only slightly modified, from a compilation of standards created by a co-worker, John Haro. He studied various selections of standards and put together a standards document. Then we hashed out any variations to the standards to be used in-house. This standard works well for us. My thanks goes to John for making this content available. It is my hope that this content will help you in your coding practices and make your code easier to read and maintain. Here it is, enjoy!

DOCUMENT CONTENTS
Type Information
Hungarian type prefixes have two parts: a base type to represent the base data type and a modifier to denote an aggregate type. An example of a base-type prefix is n, which denotes an integer, while adding the a modifier to the base type denotes an array of integers.

Dim nCount			as Integer
Dim anCounters(1 to 5)		as Integer
The variable name itself starts with an upper case character to show where the prefix stops and the variable name starts. There may be cases where you would need to use more than one modifier, as in the case of a multi-dimensional array.

Dim aanMultiTable (1 to 5, 1 to 10) As Integer

The letter 'a' is the only single type aggregate supported by Visual Basic, so it will be the only type modifier listed here. (note: a collection is not single type and is denoted by the prefix 'col').

Calls made to windows API functions are commonly given different naming conventions such as sz and LPSTR. These standards are used in MS Windows documentation and for simplicity and reference should not be modified. You may also see p used to denote a pointer and pcb used to denote the address of a callback function.

For variables defined with user-defined types and classes, the base-type characters udt and c are used. The upper case C is used to name a class module, and any object created from that class is named with a lower case c. User-defined types and variables instantiated from them are prefixed with UDT and udt, respectively.

Dim cNewUser		as New CPerson
Dim udtNewUser		as New UDTPerson
Menus are named with the type prefix mnu , but the names are aggregated to show the actual structure of the menu. For example, the About item of the Help menu would be named:

mnuHelpAbout
mnuFileOpen



Home Page | VB Page | Next Page