Click to See Complete Forum and Search --> : URGENT: how do you read in a binary data file?


Sylvia Equihua
February 21st, 1999, 07:45 PM
How do you read in a binary data file and save it into an array of records?

I have the basic code for opening a file for input

open "test.dat" for binary As #1

get #1, , EmpDB

get #1, , Current

get #1, , Counter

close #1


and


open "test.dat" for binary As #1

put #1, , EmpDB

put #1, , Current

put #1, , Counter

close #1


but every time I access it, the data that I saved is not there!

any help would be apprciated it!

net23uk
May 31st, 2000, 06:56 AM
Not sure if this is the answer, but I think you may need to get VB to allocate you a File number rather than giving it #1 Eg.

fin=freefile
open "test.dat" for binary as #fin




otherwise it does weird stuff.

Scott

---
Freeware VB programs at http://net23uk.freeservers.com