Solved

Loading binary Files

Posted on 1998-03-21
3
144 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
  • 2
3 Comments
 
LVL 2

Expert Comment

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

Author Comment

by:omsec
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now