CIS 230

Ch. 5, Worksheet #2 Answers

The following procedures are part of the same VB project. Answer the questions below.

Private Sub cmdCommand1_Click( )
    Dim A As Integer
    Dim B As Long
    A = 5
    B = 10
    Call Subrou(A, B)
    Text1 = A
    Text2 = B
End Sub
 

Private Sub Subrou(ByVal X As Integer, Y As Long)
    X = 300
    Y = Y * 5
End Sub

 

 

Questions:

1. Name an event procedure. cmdCommand1_Click
2. Name a general function. none are shown
3. What is the calling procedure? cmdCommand1_Click
4. Name an argument. A
5. What is the parameter list of Subrou? ByVal X As Integer, Y As Long
6. Is any argument passed by reference? If so, list one. B is passed ByRef
7. Name a local variable. A
8. What is the header of cmdCommand1_Click? Private Sub cmdCommand1_Click( )
9. Assuming cmdCommand1_Click is invoked, what is appears in the textbox Text1? 5
10. Assuming cmdCommand1_Click is invoked, what is appears in the textbox Text2? 50