Solved

Loading binary Files

Posted on 1998-03-21
3
148 Views
Last Modified: 2010-04-06
Hi, i've created a file format called '.OCQ'. I used it former in 16-bit BP7 - Programs. Now i want to load these files in a delphi 3 program. i know how to use BlockRead, records and Pointers in BP but not how to do that in Delphi.

thanx, Omsec ;)
0
Comment
Question by:omsec
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Expert Comment

by:egono
ID: 1360668
IMHO it's exactly the same like in BP7
0
 
LVL 2

Author Comment

by:omsec
ID: 1360669
uhm, it told me var f : file and something about Sender were not compatible, btw, is there any write command which i can use to write the data ? like WriteLn ? (onto a form)
0
 
LVL 2

Accepted Solution

by:
egono earned 30 total points
ID: 1360670
hmm try that

var f: file of byte;
    p: array [0..30000] of byte;
    l:integer;

begin
AssignFile(f,'c:\autoexec.bat');
Reset(f);
BlockRead(f,p,30000,l);
CloseFile(f);

//this is your writeln :-)
Canvas.TextOut(10,10,IntToStr(p[0]));
end;

if you read records via BlockRead from a file the right var declaration is

var myrecord : record packed
         a:byte;
         b:byte;
     end;

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question