Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Binary File read and parsing
Message
De
26/01/2002 10:19:12
 
 
À
24/01/2002 23:53:42
Victor Lapid
Phil. Long Distance Tel. Co.
Manila, Philippines
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00610301
Message ID:
00611040
Vues:
29
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!

Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform