System.TVarRec

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

  TVarRec = record { do not pack this record; it is compiler-generated }
    case Integer of
      0: (case Byte of
            vtInteger:       (VInteger: Integer);
            vtBoolean:       (VBoolean: Boolean);
            vtChar:          (VChar: _AnsiChr);
            vtExtended:      (VExtended: PExtended);
{$IFNDEF NEXTGEN}
            vtString:        (VString: _PShortStr);
{$ENDIF !NEXTGEN}
            vtPointer:       (VPointer: Pointer);
            vtPChar:         (VPChar: _PAnsiChr);
{$IFDEF AUTOREFCOUNT}
            vtObject:        (VObject: Pointer);
{$ELSE}
            vtObject:        (VObject: TObject);
{$ENDIF}
            vtClass:         (VClass: TClass);
            vtWideChar:      (VWideChar: WideChar);
            vtPWideChar:     (VPWideChar: PWideChar);
            vtAnsiString:    (VAnsiString: Pointer);
            vtCurrency:      (VCurrency: PCurrency);
            vtVariant:       (VVariant: PVariant);
            vtInterface:     (VInterface: Pointer);
            vtWideString:    (VWideString: Pointer);
            vtInt64:         (VInt64: PInt64);
            vtUnicodeString: (VUnicodeString: Pointer);
         );
      1: (_Reserved1: NativeInt;
          VType:      Byte;
         );
  end;

C++

class TVarRec

Properties

Type Visibility Source Unit Parent
record
struct
public
System.pas
systvar.h
System System

Description

TVarRec is used inside a function with an untyped array parameter.

The TVarRec type is used inside a function with a parameter type of array of const in Delphi. In Delphi, the compiler automatically translates each element in the array to a TVarRec value. In C++, the function parameter appears as an array of TVarRec values.

Use TVarRec to work with individual elements of the array when implementing the function that has an array of const parameter.

The VType field indicates the simple type of each TVarRec value. The variable type constants represent the values passed in the tag of the TVarRec structure. These constants, listed below, are defined in the System unit.

Delphi constants :



vtInteger

= 0;

vtBoolean

= 1;

vtCharacter

= 2;

vtExtended

= 3;

vtString

= 4;

vtPointer

= 5;

vtPChar

= 6;

vtObject

= 7;

vtClass

= 8;

vtWideChar

= 9;

vtPWideChar

= 10;

vtAnsiString

= 11;

vtCurrency

= 12;

vtVariant

= 13;

vtInterface

= 14;

vtWideString

= 15;

vtInt64

= 16;



C++ constants :



static const Shortint vtInteger

= 0x0;

static const Shortint vtBoolean

= 0x1;

static const Shortint vtCharacter

= 0x2;

static const Shortint vtExtended

= 0x3;

static const Shortint vtString

= 0x4;

static const Shortint vtPointer

= 0x5;

static const Shortint vtPChar

= 0x6;

static const Shortint vtObject

= 0x7;

static const Shortint vtClass

= 0x8;

static const Shortint vtWideChar

= 0x9;

static const Shortint vtPWideChar

= 0xa;

static const Shortint vtAnsiString

= 0xb;

static const Shortint vtCurrency

= 0xc;

static const Shortint vtVariant

= 0xd;

static const Shortint vtInterface

= 0xe;

static const Shortint vtWideString

= 0xf;

static const Shortint vtInt64

= 0x10;



Note: In C++, you can create an array of TVarRec values using the ARRAYOFCONST macro, which is defined in sysopen.h.