Just finishing up this assignment..
I need a code for the "Highest and Lowest" cmd button that will display the name and score in text boxes for the golfers with the highest and lowest from the golfer.txt file.
Here is my GUI & code so far.....
[IMG]http://www.geocities.com/rc_og/vb1.jpg[/IMG]
Private Sub cmdDisplay_Click()
Dim strName As String, intScore As Integer
Open "C:\Documents and Settings\Administrator\Desktop\golfer.txt" For Input As #6
Do Until EOF(6)
Input #6, strName, intScore
If intScore <= 70 Then
lstGolfer.AddItem strName & " " & intScore & "Professional"
ElseIf intScore <= 79 Then
lstGolfer.AddItem strName & " " & intScore & "Club Champ"
ElseIf intScore <= 89 Then
lstGolfer.AddItem strName & " " & intScore & "Good"
ElseIf intScore <= 99 Then
lstGolfer.AddItem strName & " " & intScore & "Fair"
ElseIf intScore > 99 Then
lstGolfer.AddItem strName & " " & intScore & "Duffer"
End If
Loop
Close #6
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub cmdHighLow_Click()
Dim strName As String, intScore As Integer, intTheNumH As Integer, intTheNumL As Integer
txths.Text = Str(intTheNumH)
intTheNumH = CInt(intScore)
txtls.Text = Str(intTheNumL)
intTheNumL = CInt(intScore)
txtln.Text = strName
txthn.Text = strName
Open "C:\Documents and Settings\Administrator\Desktop\golfer.txt" For Input As #6
Do Until EOF(6)
Input #6, strName, intScore
If intTheNumH > 0 Then
intScore
End If
Loop
Close #6
End Sub
^^^^I Dont Know if I am on the right track for the CMD "High Low" button, if you could help out I would greatly appreciate it. Files are attached \/ \/ Peace