Trying to find correct syntax

NJudson

Who farted?
Local time
Yesterday, 23:30
Joined
Feb 14, 2002
Messages
297
I'm writing code to access a text file and my code is kinda like this

Open InputFile1 For Input Access Read As #1
Open InputFile2 For Input Access Read As #2
Open OutputFile For Output As #3

Do Until EOF(1)
....(code)

Do Until EOF(2)

Loop

Loop


--now I would like to place in the line above "Do Until EOF(2)" a statement that will bring me to the top of InputFile2. I tried BOF(2) but there apparently is no such thing as that.

If "End Of File on InputFile1" = EOF(1)
then what is the correct syntax for
"Beginning Of File on InputFile2" = ????

I hope I explained what I'm looking for ok. Thanks for any help.
 
As I understand your structure you're analyzing the data in InputFile2 for each record in InputFile1.

To "go to the beginning" of InputFile2 try this:

Open InputFile1 For Input Access Read As #1
Open OutputFile For Output As #3

Do Until EOF(1)
....(code)

Open InputFile2 For Input Access Read As #2
Do Until EOF(2)

Loop
Close #2

Loop

In this way you open InputFile2 (at the first record) for each iteration of InputFile1.

HTH,
Jeff
 

Users who are viewing this thread

Back
Top Bottom