|
-
Mar 26th, 2000, 02:56 AM
#1
Thread Starter
New Member
Hi,
I wrote a Prog. that read me 10 lines from a file in ( for n = 1 to 10 ... )
Is there any way to read the 11th to 20th line in? ( for n = 10 to 20 dont
work )
He should leave the first 10 lines alone, and only read the 11th to the 20th
file...
thanks.
Kreuzer Michael
-
Mar 26th, 2000, 03:01 AM
#2
Hyperactive Member
The code would be n = 11 to 20 and not n = 10 to 20. But could you post the code that you are using? Maybe it is another problem.
Andrew
-
Mar 26th, 2000, 06:36 AM
#3
Hyperactive Member
Read the 10 first lines into a dumb variable, then the lines you really want to read:
-----
For i = 1 to 10
Line Input #1, a$
Next
For i = 11 to 20
Line Input #1, a$
Do Your Stuff
Next
Close
-----
Or, if you want to read the rest of the file:
-----
While Not EOF(1)
Line Input #1, a$
Do Your Stuff
Next
Close
-----
[Edited by Juan Carlos Rey on 03-26-2000 at 06:39 PM]
-
Mar 26th, 2000, 09:31 AM
#4
Fanatic Member
A little correction
Juan Carlos' code:
Code:
While Not EOF(1)
Line Input #1, a$
Do Your Stuff
Next
Close
Should be:
Code:
While Not EOF(1)
Line Input #1, a$
Do Your Stuff
Wend
Close

All the best.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|