' Ch. 8 Demo Program #1
' Mr. Minich
' This program illustrates the use of an array of variables, a For loop, and
'   printing directly on a form.


Option Explicit
Dim TestScores(0 To 4) As Integer     ' stores student test scores


Private Sub cmdEnter_Click()
    Static j As Integer             ' loop variable
         
    TestScores(j) = Val(txtUserInput)
    j = j + 1
    
    txtUserInput = ""
End Sub

Private Sub cmdPrint_Click()
    Dim j As Integer            ' loop variable

    Print "Student Test Scores" ' printing directly to the form
    Print                       ' prints a blank line
    
    For j = 0 To 4
        Print "Student "; j + 1, TestScores(j)
    Next j

End Sub