What's new

Need some VB Help with FileGet

cooliscool

Nintendo Zealot
How can I make my app stop reading a file (in binary mode) with FileGet at a certain offset? I need it to start at reading from 00000006 and stop at 00000063.. here's a bit my current code:

FileGet(3, d, 6) <- I need this to start at 6 and end at 63 instead of going on until the EOF
FilePut(1, c)
FilePut(1, d, 8918)
FileGet(3, d, 64)
FilePut(1, c, )
FilePut(1, d, 40960)

If I could get past this my memcard program would be complete.. thanks for any help anyone can provide.
 
Last edited:

_Chrono_

aka Chrono Archangel
never used FileGet... you cant use FileStream?
FileStreams seem much easier to use since you can seek and set a number of bytes to read... at least thats what i used for my MP3 tag reader/writer :p

Edit: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctloc.asp
seems Loc can return the position of the open file. with this you should be able to loop and stop when Loc is at the desired value.

hope that helps
 
Last edited:
OP
C

cooliscool

Nintendo Zealot
Hmm.. I'll check out re-doing my code with filestreams instead.

Thanks for the reply chrono. :)
 

Top