Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Quoting from the Delphi 2007 help:</p> <blockquote> <p>Use GetEnumName to convert a Delphi enumerated value into the symbolic name that represents it in code.</p> </blockquote> <p>That means that you can't use it for that purpose, as <em>TVarData.VType</em> is not an enumerated value, but an integer which is set to one of the constants in System.pas that are taken from the Windows SDK <em>wtypes.h</em> file. Look at the source of <em>GetEnumName()</em>, it does immediately return a string containing the value of the integer.</p> <p><strong>Edit:</strong></p> <blockquote> <p>is there any other way to get the string representation of TVarData.VType</p> </blockquote> <p>You can determine the string representation manually. First you need to be aware of that there are several bits of information encoded in that integer, so a simple case statement or array lookup will not work. The lower 12 bits are the type mask, and the upper bits encode information about whether it is a vector or array type and whether it is given by reference or not. The important parts are:</p> <pre><code>const varTypeMask = $0FFF; varArray = $2000; varByRef = $4000; </code></pre> <p>So you could do something like:</p> <pre><code>function VariantTypeName(const AValue: TVarData): string; begin case AValue.VType and varTypeMask of vtInteger: Result := 'integer'; // ... end; if AValue.VType and varArray &lt;&gt; 0 then Result := 'array of ' + Result; if AValue.VType and varByRef &lt;&gt; 0 then Result := Result + ' by ref'; end; </code></pre>
    singulars
    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. 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.
    3. VO
      singulars
      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