frostwhitedc4
04-28-2003, 11:15 PM
im suppose to make an app that opens this file with names
name, sex (f/m/), and age within it and display the average date and number of males and females. this is the code i have for the display button
Private Sub cmdDisplay_Click()
Dim strAverage As String, intItem As Integer
Open "G:\Visual Basic 6 Student Files\Tut07\lc2.dat" For Input As #1
Do While Not EOF(1)
Input #1, strAverage, intItem
Select Case strAverage
Case "male"
lblTotalMale.Caption = Val(lblTotalMale.Caption)
Case "female"
lblTotalFemale.Caption = Val(lblTotalFemale.Caption)
End Select
Loop
Close #1
End Sub
when i click that display button, the lblTotalMale.caption and lblTotalFemale.caption would display 0. can u help me?
name, sex (f/m/), and age within it and display the average date and number of males and females. this is the code i have for the display button
Private Sub cmdDisplay_Click()
Dim strAverage As String, intItem As Integer
Open "G:\Visual Basic 6 Student Files\Tut07\lc2.dat" For Input As #1
Do While Not EOF(1)
Input #1, strAverage, intItem
Select Case strAverage
Case "male"
lblTotalMale.Caption = Val(lblTotalMale.Caption)
Case "female"
lblTotalFemale.Caption = Val(lblTotalFemale.Caption)
End Select
Loop
Close #1
End Sub
when i click that display button, the lblTotalMale.caption and lblTotalFemale.caption would display 0. can u help me?