Recent

Author Topic: what's difference between Variant and TVarRec?  (Read 574 times)

egsuh

  • Hero Member
  • *****
  • Posts: 1360
what's difference between Variant and TVarRec?
« on: April 24, 2024, 05:24:24 pm »
They seem very similar. Well, TVarRec is variant record. But isn't variant variant record?

ASerge

  • Hero Member
  • *****
  • Posts: 2275
Re: what's difference between Variant and TVarRec?
« Reply #1 on: April 24, 2024, 07:09:52 pm »
They seem very similar. Well, TVarRec is variant record. But isn't variant variant record?
Do not confuse TVarRec with TVarData, which is the internal representation of Variant.
TVarRec is an element of the array of const.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5539
  • Compiler Developer
Re: what's difference between Variant and TVarRec?
« Reply #2 on: April 25, 2024, 09:28:59 pm »
They seem very similar. Well, TVarRec is variant record. But isn't variant variant record?

Variant by itself is an opaque type backed by a variant record (TVarData) that also allows to invoke methods and properties on the Variant (compared to TVarRec). Another modern variant record is Rtti.TValue.

 

TinyPortal © 2005-2018