Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So you want "to get the raw value of the underlying Variant without having to access the indexed property directly and thus triggering the conversion Exception". So long as you can access the underlying Variant itself, yes, you can. You will need to change the container class itself most likely.</p> <p>From <a href="http://docwiki.embarcadero.com/RADStudio/en/Variant_Types" rel="nofollow">the Delphi XE2 help page on variant types</a>:</p> <blockquote> <p>The standard function <code>VarType</code> returns a variant's type code. The <code>varTypeMask</code> constant is a bit mask used to extract the code from <code>VarType</code>'s return value, so that, for example, </p> </blockquote> <pre><code>VarType(V) and varTypeMask = varDouble </code></pre> <blockquote> <p>returns <code>True</code> if <code>V</code> contains a <code>Double</code> or an <code>array of Double</code>. (The mask simply hides the first bit, which indicates whether the variant holds an array.) The <code>TVarData</code> record type defined in the <code>System</code> unit can be used to typecast variants and gain access to their internal representation.</p> </blockquote> <p>You should be able to use a combination of the methods and records mentioned here to find out anything you want about the internal data inside the variant, including if it's a NULL variant, as well as getting direct access to it.</p> <p>(This system seems slightly dodgy design to me: it doesn't seem a very type safe implementation... see my comment above. I think a design based on the actual types of the values you are expecting might be safer. But, this will let you achieve your goal.)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload