Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Binary File read and parsing
Message
From
26/01/2002 10:19:12
 
 
To
24/01/2002 23:53:42
Victor Lapid
Phil. Long Distance Tel. Co.
Manila, Philippines
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00610301
Message ID:
00611040
Views:
28
Use code like the following to parse you binary files:
Private Type CharRecord   ' Define user-defined type.
   Char As String * 1
End Type

Dim MyRecord As CharRecord, _
Position As Integer, _
MySize As Integer

MySize = FileLen("C:\TEST.DAT")   ' Returns file length (bytes).

Open "C:\TEST.DAT" For Random As #1 Len = Len(MyRecord)   ' Open it for random access with 1 character records

Position = 3   ' Define record number.
Get #1, Position, MyRecord   ' Read third character.

Debug.Print MyRecord.Char   ' Send it to immediate window

Close #1    'Do not forget this
Advice whether this is what you need!
Kind Regards
Zlatin Zlatev,
MCSD (VS6)

Make solutions, not programs!

Previous
Reply
Map
View

Click here to load this message in the networking platform