Re: Reading Binary into array.
- From: "Rick Rothstein \(MVP - VB\)" <rickNOSPAMnews@xxxxxxxxxxxxxxxxx>
- Date: Tue, 6 Mar 2007 23:20:14 -0500
First let me apologies for pestering you all... but so far all the advice
has helped my application move along way from theory stage to working
stage...
Asking questions, looking for help in getting problems solved is not
"pestering"... why do you think these newsgroups exist?
I'm wanting to work with a file as binary, but as part of my application
will allow an offset into the file, and the filesize will be a maximum of
64kb, I'm thinking it might be easier to work with the file within an
array (reading it into it) or something, so the offset can just work
within the array rather than reading the file constantly of the drive.
Another possibility, depending on your program's needs, is to simply read
the entire file into a String variable and use the Mid$ function to pull out
sub-strings of text at given offsets.
Dim FileNum As Long
Dim TotalFile As String
FileNum = FreeFile
Open YourFileNameAndPath For Binary As #FileNum
TotalFile = Space(LOF(FileNum))
Get #FileNum, , TotalFile
Close #FileNum
At this point, the TotalFile variable contains the entire file as a String.
Rick
.
- References:
- Reading Binary into array.
- From: Kardon Coupé
- Reading Binary into array.
- Prev by Date: Re: VB 2005 DDL in VB 6.0 project
- Next by Date: Re: Boolean logic question
- Previous by thread: Re: Reading Binary into array.
- Next by thread: Ole objects seen twice in rtf
- Index(es):
Relevant Pages
|