Pass array
Visual Basic
1
Posts
1
Posters
0
Views
1
Watching
-
I have the following code: My question is: how to pass a element od array to procedure to validate? Private Sub btnStart_Click() Dim Age(0 To 5) As String '6 element array Dim Counter As Integer For Counter = 0 To 5 Age(Counter) = InputBox("Records entered:" & Counter & " Please Enter Age :") Call checkAge(Age()) Next End Sub Sub checkAge(Age()) If Age < 17 Then MsgBox "You should not drive yet" Else MsgBox "Eligible for driving" End If End Sub