Written by Rod Wing.
Variable (or object) naming standards in the programming world can be compared to layer/level naming standards in the CAD world. Just as the U.S. National CAD Standards specification is the benchmark for CAD layer/level names, Hungarian Notation is the benchmark for programming code.
The basic syntax of Hungarian notation is that each variable uses a standard prefix coding scheme (or mnemonic) of lower case letters that denote the scope and type of the variable, followed by the name which begins with an upper case letter. Typically a first letter of “g” denotes a global (or public) variable, while a first letter of “m” indicates a module level variable. Using the variable name mlngCount we would know without looking at the Dim statement that this is a module level variable of type Long and that its name is Count. Likewise there are VBA specific extensions to the specification. Using the example object cmdCancel it would be easy to guess that this refers to a form’s Cancel command button.
Just like layer/level naming standards each organization has their own variable naming standards. The most important thing to remember about a variable naming standard is not which one you use, but just use one and stick with it.
For an overview of Hungarian notation you can visit:
VB/VBA specific specifications can be found here:
Last Month’s Tips:MicroStation: Backup & Undo InRoads: OpenRoads VBA: Comparing MicroStation Pirate: Terrain Elements Floating Point Numbers Selection Port-Starb… Don’t want to miss out on other great information? Subscribe to this blog or our monthly eNewsletter now! Learn More ◊ Contact us today ◊ Newsletter ◊