In addition to prefixing a variable to denote its data type, you can and should use a prefix to denote its scope. The scope designation character precedes the data type prefix and is separated from it by an underscore. For example, to denote a module-level string variable, you can use a statement such as the following:
Dim m_strName As String
Table 3-2 contains the prefixes that you use to describe scope.
| Prefix | Description | Example |
|---|---|---|
| g | Global | g_strSavePath |
| m | Local to module or form | m_blnDataChanged |
| st | Static | st_blnInHere |
| (no prefix) | Nonstatic, local to procedure | intIndex |