Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Delphi Programming question

Posted on 1997-09-06
3
Medium Priority
?
502 Views
Last Modified: 2012-06-27
I have encountered problems with the move from Delphi2 to Delphi3.  I have a reasonably sized record that I like writing to a sequential file.  
I simply used:
"var afile: file of ColumnRecord" and then wrote the records sequentially to a file with standard pascal. (Assigned the file, wrote to "afile", etc.)
Now Delphi 3 won't let me to this with my record and states that
"ColumnRecord needs finalization".  I don't particularly want to  rewrite the record as I would have to rewrite the rest of the software.
a) is there a way around this
b) is there a better way to write sequential records to a file
(such as objects and streams? )  If so, how would I do this?

Enclosed is the code for the record, which in itself contains a record..

type
  FontRecord = record
    Color: TColor;
    Height: Integer;
    Name: TFontname;
    Pitch: TFontPitch;
    PixelsPerInch: Integer;
    Size: Integer;
    Style: TFontStyles;
  end;
  ColumnRecord = record
    ColFieldName: string[80];  // the actual name of the field
    ColWidth: integer;         // width of column
    ColFont: FontRecord;            // font
    ColTitle: string[80];    // title of column
    ColTitleFont: FontRecord;     // title font
    ColLabel: string[80];      // label for field item
    ColLabelFont: FontRecord;        // font of the label
    ColFieldNumber: Integer;   // the table # of the field
    ColVisible: boolean;       // whether to print this column
    ColIncludeLabel: boolean;  // if true, include ColLable
    ColNewLine: boolean;       // starts a new line if true
    ColHideIfEmpty: boolean; // include if empty
  end;

Thank you very much for your help.   EMAIL seitza@docker.com
0
Comment
Question by:seitza
[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
  • 3
3 Comments
 
LVL 3

Accepted Solution

by:
mirek071497 earned 200 total points
ID: 1344191
You must change only one in tFontRecord.

Name : String[LF_FACESIZE-1];

You must change this not only for finalization of record You must change this for compatibility wit previously created files.

Delphi2 define
TFontName = string[LF_FACESIZE-1]
but Delphi3 define
TFontName = type string;

LF_FACESIZE is 32 and all previus files have the size of FontName.

Regards
Mirek
0
 
LVL 3

Expert Comment

by:mirek071497
ID: 1344192
do you try my suggestions ?
0
 
LVL 3

Expert Comment

by:mirek071497
ID: 1344193
200pt and you don't need solution?
0

Featured Post

Technology Partners: 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

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…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

721 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