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
Solved

Delphi Programming question

Posted on 1997-09-06
3
493 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 100 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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

766 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