Programming: Variable naming conventions

From virtualMV2015wiki
Jump to: navigation, search
 Home  Main Page <

Table of commonly used prefixes

In order to make reading a program's code easier, many programmers prefix variables to help identify their type The following table lists some commonly used prefixes. They are pretty standard for VisualBasic but can be used effectively in other languages.

dtmDate and/or TimedtmEnd
intIntegerintX, intDay
vntVariant (an untyped number e.g. JavaScript)vntTotal
Numeric (approx values shown)
bytByte (1 byte:0-255)intX, intDay
intInteger (2 byte:+/- 32,768)intI, intDay
lngLong (4 bytes:+/- 2,147,483,648)lngBillsSalary
sngSingle (4 bytes:Negative values: -3.402823E+38 to -1.401298E-45; Positive values: 1.401298E-45 to 3.402823E+38)lngBillsSalary
sngDouble (8 bytes:Negative values: -1.79769313486232e+308 to -4.94065645841247E-324; Positive values: 4.94065645841247E-324 to 1.79769313486232e+308)lngBillsSalary
curCurrency (8 bytes:+/-922,337,203,685,477.5808)lngBillsSalary
Form controls
cboCombo boxcboWeekDays
lstList boxlstFullName
txtText boxtxtFirstName


  • For an array use the array type e.g. strDays[1], intDayNum[1] or arrX

References: Oracle Thinkquest(n.d.)[1], University of Illinois (2008)[2], (n.d.)[3]

Microsoft (2009)[4]

Icon References.png References

  1. Oracle Thinkquest(n.d.) Intro to Variables. Retrieved January 15, 2009 from
  2. University of Illinois (2008). Constant and Variable Naming Conventions. Retrieved January 15, 2009 from
  3. (n.d.) Object Types and Naming Scheme (VB6). Retrieved January 15, 2009 from
  4. Microsoft (2009). INFO: Microsoft Consulting Services Naming Conventions for Visual Basic. Retrieved April 3, 2009 from

Programming: Variable naming conventions. (2018). In virtualMV's ( Michael Verhaart ) wiki. Retrieved November 14, 2018, from    (zotero)