Difference between revisions of "Coding Conventions"

From vb24
Jump to navigation Jump to search
Line 1: Line 1:
 +
== Separators ==
 +
* '##########
 +
 +
== Organization ==
 +
* called functions after calling functions
 +
* grouping functions (VBA Access Form: Form, Controls, Methods)
 +
 +
== Comments ==
 +
 
== Function Names ==
 
== Function Names ==
 
A function name
 
A function name
Line 10: Line 19:
 
End Sub
 
End Sub
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
== Line breaks ==
  
 
== Blank lines ==
 
== Blank lines ==
 +
* Dim block
 +
* if, select, etc
 +
 +
== Error Handling ==
 +
 +
== Name parameters ==
 +
* Param:="Xyz"
 +
 +
== Obsolete constructs ==
 +
* Call
 +
* Set Nothing

Revision as of 10:58, 19 April 2010

Separators

  • '##########

Organization

  • called functions after calling functions
  • grouping functions (VBA Access Form: Form, Controls, Methods)

Comments

Function Names

A function name

  • describes what the function does
  • starts with a verb
  • starts lowercase
Sub reportDifference()
    '...
End Sub

Line breaks

Blank lines

  • Dim block
  • if, select, etc

Error Handling

Name parameters

  • Param:="Xyz"

Obsolete constructs

  • Call
  • Set Nothing