[fpc-devel] TField.OldValue

LacaK lacak at zoznam.sk
Thu Jun 9 08:58:06 CEST 2011


Hi *,
I have 2 questions, which I divide into 2 emails.

1st is about TField.OldValue and Delphi compatibility. Please look at 
small attached program (for SQLite3).

In Delphi (with TClientDataSet and dbExpress) outputs:
1. Field.OnValidate: OldValue=N; Value=N; NewValue=N
2. Field.OnChange: OldValue=O; Value=N; NewValue=N
3. BeforePost: OldValue=O; Value=N; NewValue=N
4. AfterPost: OldValue=O; Value=N; NewValue=N
5. Before ApplyUpdates: OldValue=O; Value=N; NewValue=N
6. After ApplyUpdates: OldValue=N; Value=N; NewValue=N

In FPC:
1. Field.OnValidate: OldValue=N; Value=N; NewValue=N
2. Field.OnChange: OldValue=null; Value=N; NewValue=N
3. BeforePost: OldValue=null; Value=N; NewValue=N
4. AfterPost: OldValue=O; Value=N; NewValue=N
5. Before ApplyUpdates: OldValue=O; Value=N; NewValue=N
6. After ApplyUpdates: OldValue=null; Value=N; NewValue=N

As you can see, there are differences in 2,3,6, where in FPC OldValue is 
NULL but in Delphi is it "old value".
Dou you think, that it is bug ? (at least it makes impossible compare 
OldValue and Value in BeforePost event handler and take some action when 
some field changes)

TIA
L.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: testOldValue.pas
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20110609/008ae7d9/attachment.ksh>


More information about the fpc-devel mailing list