|
-
Nov 24th, 2018, 02:17 PM
#1
New Member
Re: Rewinding ascii files
From the VB forum there is some anwers here : http://www.vbforums.com/showthread.p...-Seek-function
-->
You can set the position with Seek.
VB Code:
1.Dim ByteToGet As Byte
2.
3.Open "c:\test.txt" For Binary Access Read As #1
4. Seek #1, 2
5. Get #1, , ByteToGet
6. Debug.Print ByteToGet
7. Seek #1, 1
8. Get #1, , ByteToGet
9. Debug.Print ByteToGet
10.Close #1
Didn't test, hope it works
If I am not mistaken, you can use seek in two ways.
To read the current position, it accepts 1 parameter:
pos = Seek #1
To set the position it accepts 2 parameters, but is doesn't return a value:
Seek #1, 0
where the second parameter is the position to jump to.
Probably MSDN has two different pages for Seek (just like it has for Date)
I can't check it right now, because i am not behind a machine with VB6 at the moment, but this is what i remember from it.
Best regards
ZOne 51 technology based
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
|