Reading Binary File

How could one read the data contents of a specific byte of a binary file, for example data read out form an Eprom
spurs1Asked:
Who is Participating?
 
Erick37Connect With a Mentor Commented:
Here is an example of reading one byte from a file:

Private Sub Command1_Click()
    Dim i As Long
    Dim fSize As Long
    Dim Data As Byte
    ' Open file in random-file mode.
    Open "c:\test.bmp" For Random As #1
    fSize = LOF(1) ' Gets file size.
    i = 100 ' get byte 100
    Seek #1, i   ' Set position.
    Get #1, , Data  ' Read byte.
    Close #1    ' Close file.
    Debug.Print Data
End Sub
0
 
Erick37Commented:
Make that Open "c:\test.bmp" For Binary As #1

Change to Binary for byte reads!!!
0
 
fmuftiCommented:
My friend posted this quiestion on my behalf so once I get the solution I'll ask him to award the points.
The problem is a binary file as three portions first the bytes( offset), data, ASCII. I want to read the data which is hex e.g at byte 20 if the velue is 6F, I want to read 6F as it is.
Now some one help me.
0
All Courses

From novice to tech pro — start learning today.