[fpc-devel] RFC: TParam.AsBCD vs. AsFMTBCD

2011-02-23 Thread LacaK

Hi,
we have in fcl-db TField.AsBCD: TBCD; but we do not have TParam.AsBCD, 
nor TParam.AsFMTBCD

Delphi defines:
TParam.AsBCD: Currency ... 
http://docwiki.embarcadero.com/VCL/XE/en/DB.TParam.AsBCD
TParam.AsFMTBCD: TBCD ... 
http://docwiki.embarcadero.com/VCL/XE/en/DB.TParam.AsFMTBCD


But for me sounds more logical and consistent, that TParam.AsBCD will be 
like TField.AsBCD so result type will be TBCD

(TParam.AsBCD: Currency is more like TParam.AsCurrency: Currency)

So what way to go ?
1. TParam.AsBCD: TBCD
2. TParam.AsFMTBCD: TBCD

Laco.

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] RFC: TParam.AsBCD vs. AsFMTBCD

2011-02-23 Thread michael . vancanneyt



On Wed, 23 Feb 2011, LacaK wrote:


Hi,
we have in fcl-db TField.AsBCD: TBCD; but we do not have TParam.AsBCD, nor 
TParam.AsFMTBCD

Delphi defines:
TParam.AsBCD: Currency ... 
http://docwiki.embarcadero.com/VCL/XE/en/DB.TParam.AsBCD
TParam.AsFMTBCD: TBCD ... 
http://docwiki.embarcadero.com/VCL/XE/en/DB.TParam.AsFMTBCD


But for me sounds more logical and consistent, that TParam.AsBCD will be like 
TField.AsBCD so result type will be TBCD

(TParam.AsBCD: Currency is more like TParam.AsCurrency: Currency)

So what way to go ?
1. TParam.AsBCD: TBCD
2. TParam.AsFMTBCD: TBCD


Well, the Delphi compatible way is usually preferred.


It makes no sense to have both .asBCD and asFMTBCD to have the same result type.

The same can of course be said about .asBCD and .AsCurrency; But since
Delphi compatibility is a goal, I think we should follow them.

Borland could perfectly have sufficed with 2 properties (.AsCurrency, AsBCD). 
For some reason they introduced 3.


Michael.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] RFC: TParam.AsBCD vs. AsFMTBCD

2011-02-23 Thread LacaK
Ok, here is patch for AsFMTBCD: TBCD ... 
http://bugs.freepascal.org/view.php?id=18809

Please review.
It seems, that methods TParam.GetData and SetData are not used at all 
... strange ;-)

Laco.


Well, the Delphi compatible way is usually preferred.


It makes no sense to have both .asBCD and asFMTBCD to have the same 
result type.


The same can of course be said about .asBCD and .AsCurrency; But since
Delphi compatibility is a goal, I think we should follow them.

Borland could perfectly have sufficed with 2 properties (.AsCurrency, 
AsBCD). For some reason they introduced 3.


Michael.


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel