Data Type Prefix

Therefore, a data type prefix can tell you the programmer (and the other programmers who are reading or modifying your code) what type of data you intend for a variable to hold. In other words, Variant variables can hold any kind of data, but in practice, any given variable should generally only hold one kind of data. This is not an absolute, as there are certainly legitimate circumstances under which you would intend for a variable to be able to hold multiple data types. By placing a placing a data type prefix in front of your variable name, you make it obviously clear what type of data you intend for that variable to hold, even if you intend for it to, or expect that it night need to, hold multiple types of data. Here is a short list of data type prefixes that are commonly used.

var - Variant
str - String
int - Integer
lng - Long
byt - Byte
sng - Single
dbl - Double
cur - Currency
obj - Object
bool - Boolean

The variable prefix is best used when you don't know exactly what type of data might end up in a variable, or when you intend for that variable to hold all kinds of data.

First
Next