Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2008-05

please make TField.SetDataset virtual

9 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Paul Ishenin

Hello, FPC developers' list.

For delphi compatibility TField.SetDataset should be virtual and placed in the protected section. Please apply attached patch to correct this and if not difficult, please apply into fixes.

I help to convert Fib+ library to FPC/Lazarus and this was one of the problems we found.

Thanks.

Best regards, Paul Ishenin.

Reply by email

Paul Ishenin
to Paul Ishenin
Paul Ishenin wrote
I help to convert Fib+ library to FPC/Lazarus and this was one of the problems we found.

Found one more incompatibility - TField.SetAsVariant declaration is differ:

delphi:
procedure SetAsVariant(const AValue: variant); virtual;
fpc:
procedure SetAsVariant(AValue: variant); virtual;

Can 'const' can be added to the fpc declaration?

Patch that fixed both incompatibilities is attached.

And, btw: GetDataSize and SetSize have word argument in fpc while in delphi they are integer. I think this incompatibility will not be fixed
- so I will live with it.

Thanks.

Best regards,
Paul Ishenin.

Reply by email

Paul Ishenin
to Paul Ishenin
Paul Ishenin wrote 6 lines
Paul Ishenin wrote: > I help to convert Fib+ library to FPC/Lazarus and this was one of the > problems we found. > Found one more incompatibility - TField.SetAsVariant declaration is differ:

Sorry, I was impatient with sending first problems. I found more and this is the last patch since I compiled the whole library now :)

Patch fixed next incompatibilities:

TField:
1. make SetDataset virtual
2. pass SetVariant argument as const
3. add Lookup property

TDataset:
1. add SetDefaultFields protected method

I also cannot keep me from correcting wrong char case of few words like "AlignMent".

Best regards,
Paul Ishenin.

Reply by email

Joost van der Sluis
to Paul Ishenin

Op donderdag 29-05-2008 om 16:54 uur [tijdzone +0800], schreef Paul Ishenin:

Show quoted text 13 lines
Paul Ishenin wrote: Sorry, I was impatient with sending first problems. I found more and this is the last patch since I compiled the whole library now :) Patch fixed next incompatibilities: TField: 1. make SetDataset virtual 2. pass SetVariant argument as const 3. add Lookup property TDataset: 1. add SetDefaultFields protected method

Thanks, committed.

I also cannot keep me from correcting wrong char case of few words like "AlignMent".

You are forgiven. ;)

Joost.

Reply by email

Paul Ishenin
to Joost van der Sluis
Joost van der Sluis wrote
Thanks, committed.

Big thanks.

I have some questions though.

1. There is no support for BCD in TField:

    function GetAsBCD: TBcd; virtual;
    procedure SetAsBCD(const Value: TBcd); virtual;
    property AsBCD: TBcd read GetAsBCD write SetAsBCD;
2. And few methods have 'word' arguments instead of 'integer':
delphi:
    function GetDataSize: Integer; virtual;
    procedure SetSize(Value: Integer); virtual;
fpc:
    procedure SetSize(AValue: Word); virtual;
    function GetDataSize: Word; virtual;

I suppose that adding empty methods for BCD support will not hurt while changing type of Size methods can break some fpc applications. Is that Size incompatibility is by design?

Best regards,
Paul Ishenin.

Reply by email

Michael Van Canneyt
to Paul Ishenin
Paul Ishenin wrote 25 lines
Joost van der Sluis wrote: > Thanks, committed. > Big thanks. I have some questions though. 1. There is no support for BCD in TField: function GetAsBCD: TBcd; virtual; procedure SetAsBCD(const Value: TBcd); virtual; property AsBCD: TBcd read GetAsBCD write SetAsBCD; 2. And few methods have 'word' arguments instead of 'integer': delphi: function GetDataSize: Integer; virtual; procedure SetSize(Value: Integer); virtual; fpc: procedure SetSize(AValue: Word); virtual; function GetDataSize: Word; virtual; I suppose that adding empty methods for BCD support will not hurt while changing type of Size methods can break some fpc applications. Is that Size incompatibility is by design?

No. It could be that Delphi 3 had an integer argument, but I'm not sure. The FPC TDataset was originally coded when Delphi was at version 3.

Adding the BCD methods should not hurt, feel free to send a patch.

Michael.

Reply by email

Paul Ishenin
to Michael Van Canneyt
Michael Van Canneyt wrote
No. It could be that Delphi 3 had an integer argument, but I'm not sure. The FPC TDataset was originally coded when Delphi was at version 3.

I am sure all delphi versions since 3 have them as Integer.

Adding the BCD methods should not hurt, feel free to send a patch.

A minimal start is attached.

Best regards,
Paul Ishenin.

Reply by email

Joost van der Sluis
to Paul Ishenin

Op vrijdag 30-05-2008 om 21:10 uur [tijdzone +0800], schreef Paul Ishenin:

Show quoted text 8 lines
Michael Van Canneyt wrote: > No. It could be that Delphi 3 had an integer argument, but I'm not sure. > The FPC TDataset was originally coded when Delphi was at version 3. > I am sure all delphi versions since 3 have them as Integer. > Adding the BCD methods should not hurt, feel free to send a patch. > A minimal start is attached.

Thanks, applied.

I'm off on vacation for about two weeks, after that I'll change the word parameters to integer ones, compatible with Delphi. But probably only in trunk for a while.

Joost.

Reply by email

Paul Ishenin
to Joost van der Sluis
Joost van der Sluis wrote
I'm off on vacation for about two weeks, after that I'll change the word parameters to integer ones, compatible with Delphi. But probably only in trunk for a while.

Ok. Hope this will be possible to merge into 2.2.3 branch later.

Best regards,
Paul Ishenin.

Reply by email