' Mr. Minich
' Period 1
' Ch3Demo2
' 9/14/2000
' Purpose - This program demonstrates the use of declaration & assignment statements.
Option Explicit
Private Sub Form_Activate()
' declaration statements *************************************************
Dim intSalary As Integer ' employee's salary
Dim intRaise As Integer
intSalary = 32500
frmMain.Print "Your salary is " & intSalary
intRaise = 200
intSalary = intSalary + intRaise
frmMain.Print "After one raise, your new salary is " & intSalary
intSalary = intSalary + intRaise
frmMain.Print "After another raise, your salary is now " & intSalary
' Overflow occurs above because the data type Integer can only store values
' as high as 32767.
End Sub
' 1. What larger data type that stores whole numbers should
' have been used for the variable intSalary?
' 2. What would the variable name be for intSalary if this different data type
' would have been used? (Hint: look up the correct prefix)
' 3. Show the intermediate values of the following variables.
' intSalary intRaise
' --------- --------