Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Delphi Programming question

Posted on 1997-09-06
3
Medium Priority
?
507 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
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

783 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