VB Lecture Notes - Variables & Data Types
Objective #1: Name variables using the appropriate data type prefixes and the proper capitalization.
Objective #2: Use Dim statements to declare variables and understand the physical process of memory (RAM) allocation.
Objective #3: Understand each of the basic data types used by Visual Basic.
data type |
prefix | characteristics |
range |
size (bytes) |
| Boolean | bln |
True or False | True or False | 2 |
| Char | chr |
a single character | 0 to 65535 | 2 |
| Integer | int |
whole numbers only | -2,147,483,648 to 2,147,483,647 | 4 |
| Double | dbl |
large numbers or decimal numbers | -1.79769313486231E308 to -4.94065645841247E-324 for negative values; 4.94065645841247E-324 to 1.79769313486232E308 for positive values | 8 |
| String | str |
text, symbols, digits, usually more than a single character | 0 to about 2 billion Unicode characters | 10 + (2 * string length) |
(We will not be using some of the data types mentioned in this chart until later in the course.)
Objective #4: Determine the scope of a variable.
Objective #5: Use constants.