[fpc-pascal] Re: Variant vs Pointer
md at delfire.net
Sat Mar 3 14:13:07 CET 2012
On Sat, Mar 3, 2012 at 9:25 AM, Alberto Narduzzi
<albertonarduzzi at yahoo.com> wrote:
>>> The reason for using a buffer in tdataset is that a record's data
>>> is located in one continuous buffer, from which a value is picked from
>>> right spot (including strings) You can't have that with variants.
>> Hm... right.
>> So, if I will have a class like a TParam, that have FValue: Variant
>> attribute, Would you change the implementation to not use Variant?
> your class could use whatever you want, of course, but the overhead of the
> Variant (a silly invention, IMHO, most probably MS related...) isn't worth.
> Your programs, more or less, will always know what data they are working
> with, hence you'll be safe and satisfied enough with the TField interface.
> Don't generalize if there isn't actually any need for it.
> I may be wrong, of course, but I strongly doubt it... ;-)
> Just my 2c
> Cheers, A.
Well, if I won't generalize I need to create one class for each type,
like TField does, but saving the data in a especific type variable.
I would like to avoid it but...
More information about the fpc-pascal