Problem with binary file

[ Follow Ups ] [ BasicCard User Forum ]

Posted by henrik ( on April 08, 2003 at 05:24:04:

I have problems open and reading from a binary file.

I define the file like this:

Dir "mydir"
File "myfile"
... here follows in total 16kb of data

End Dir

Then I try to open the file and read 32 bytes of data like this:

Private ROMaddress% As Integer
Private hashblock$ As String*32
Private file@ As Byte

ROMaddress% = &H1fe
file@ = Open "@:mydir\myfile" For Binary Access Read
Get file@,ROMaddress%,hashblock$,32
close file@

But this doesn't work, can you tell me why and/or give an example of working with binary files?


Follow Ups:

[ Follow Ups ] [ BasicCard User Forum ]