You need to change #2 to #1 because you have not assign anything to #2 yet.
Or
Have you declare your variables yet?
Printable View
You need to change #2 to #1 because you have not assign anything to #2 yet.
Or
Have you declare your variables yet?
i declared the variables already and if i change the input # to 1 i get an input past end of file error.
meth
I'm not exactly an expert on opening text files, but have you opened anything 'For Input As #2'
(Correct me if the above is a horrible misunderstanding / error)
Word of advice:
Dim fnum as integer
fnum = FreeFile()
Open "*****" for input as #fnum
I don't know what it does that is special, but I read it in a book (Programming Visual Basic 6 by Francesco Balena) and it's supposed to be more reliable.
i tried opening the file again as input#2 and vb tells me the file is already open. would it help if i posted all the code?
thanks, meth
Do this to get around your EOF problem
Code:Do While Not EOF(1)
Input #1, currentName, currentZip, nameSale
Let zipSale = nameSale
Let totalSale = nameSale
totalSale = sale + totalSale
If nom <> CurrntName Then
picOutput.Print nom; zip; sale
Let nameSale = sale
Let currentName = nom
Else
' Whatever
End If
Loop
that was it. thanks everyone.
meth