?
Solved

Loading binary Files

Posted on 1998-03-21
3
Medium Priority
?
150 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 90 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 August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free 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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month8 days, 22 hours left to enroll

765 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