CIS 230, Visual Basic

Ch. 3 Notes, page 1

Objective #1: Distinguish between variables, constants, and controls.

Objective #2: Differentiate among the various data types.

Data Type Use For Example Range Memory Requirements
Boolean True or False values True True or False 2 bytes
Byte A single letter or digit 'A' 0 to 255 1 byte
Currency Dollars and cents $42.35 -922,337,203,685,477.5808 to 922,337,203,685,477.5807 8 bytes
Date calendar dates 3/14/99 January 1, 100 to December 31, 9999 8 bytes
Double Floating point (decimal) numbers with 14 digits of accuracy 7.34432134567 -1.79769313486232E308 to -4.94065645841247E-324 8 bytes
Integer whole numbers 15 -32,768 to 32,767 2 bytes
Long big whole numbers 71,345,678 -2,147,483,648 to 2,14,483,647 4 bytes
Single Floating point (decimal) numbers with 6 digits of accuracy 3.14159 -3.402823E38 to -1.401298E-45 for negatives and 1.401298E-45 to 3.402823E38 for positives 4 bytes
String Alphanumeric data (letters and/or digits) "199-99-3214" 0 to 2 billion 1 byte per character + 10 bytes
Variant any type of data anything any value up to a Double if a number

1 to 65,400 if alphanumeric

16 bytes, if a number

22 bytes + 1 byte for each character, if alphanumeric

Objective #3: Apply naming conventions incorporating standards and indicating scope and data type.

Prefix Data Type
bln Boolean
cur Currency
dbl Double
dtm Date
int Integer
lng Long
sng Single
str String
vnt Variant

Objective #4: Declare variables using the Dim statement.

Objective #5: Select the appropriate scope for variables and constants.

Objective #6: Convert text input to numeric values using the Val function.

Objective #7: Perform calculations using variables and constants.

Objective #8: Format values for output using the formatting functions.

Objective #9: Accumulate sums and generate counts.

Objective #10: Format data for output.

Objective #11: Modify the environment to require Option Explicit.


CIS 230 Home Page | Mr. Minich's Education Home Page | Minich.com Web Design