Solved

Loading binary Files

Posted on 1998-03-21
3
149 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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

696 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