![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Programmer
Join Date: Feb 2005
Posts: 62
Rep Power: 4
![]() |
[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? |
|
|
|
|
|
#2 |
|
Expert Programmer
|
why don't you throw a conditional statement in there, instead of looping twice?
Do While Not EOF(1) line input #1, tempstring if tempstring == "whatever" then else end if loop |
|
|
|
|
|
#3 | |
|
Programmer
Join Date: Feb 2005
Posts: 62
Rep Power: 4
![]() |
Quote:
|
|
|
|
|
|
|
#4 |
|
Expert Programmer
|
That's what I was wondering. Clean up, and then post some of your code. Explain what your trying to do. Perhaps there is a more efficeient way. The other thing I was wondering was where the problem was. It didnt seem as simple as you made it out to be. Perhaps theres another governing factor?
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|