[fpc-pascal] Re: Variant vs Pointer

Alberto Narduzzi albertonarduzzi at yahoo.com
Sat Mar 3 13:25:36 CET 2012


>> The reason for using a buffer in tdataset is that a record's data normally
>> is located in one continuous buffer, from which a value is picked from the
>> 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.



More information about the fpc-pascal mailing list