tags:

views:

252

answers:

3

hi all

how to read data from .dat files ?

i just tried like this memo1.lines.loadfromfile('c:\myfile.dat'); but not worked

Note : File type is binary

can any one please help me :)

A: 

You might look at this post as they seem to be discussing this very thing.

Fred
+4  A: 

@radick to show the contents of an binary file in a memo control you must encode o convert the data to valid ASCII characters, to turn it all into text. because you can not load something that is not text into a text control.

you can find a very nice sample from Peter Below in this link.

read a binary file and display the byte values as ASCII?

alt text

RRUZ
+1  A: 

Use the TStream descendants from the VCL Classes unit to read binary files.

There are plenty Delphi TStream reading binary files examples you can find using Google.

--jeroen

Jeroen Pluimers