View Single Post
Old May 15th, 2006, 4:34 PM   #1
chepfaust
Programmer
 
chepfaust's Avatar
 
Join Date: Feb 2005
Posts: 62
Rep Power: 4 chepfaust is on a distinguished road
[VB6] Resetting "Line Input"

i am parsing a text file using a do loop with a line input statement.

once that loop is done, i need to make another one to parse for something different.

the problem i am having is that when i open up the second loop, line input continues reading from the text file where i left off with the first loop.

pseudocode:
----------------------------------------------
open file for input as #1
-- do until tempstring = "stuff" or EOF(1)
-- -- line input #1, tempstring
-- loop
-- process tempstring a certain way
close #1

open file for input as #2
-- do until tempstring = "something else" or EOF(2)
-- -- line input #2, tempstring
-- loop
-- process tempstring another way
close #2
----------------------------------------------

how do i make line input start from the top of the file? can i manually trick VB into thinking EOF was reached, therefore starting over?
chepfaust is offline   Reply With Quote