System.TVarRec

De RAD Studio API Documentation
Aller à : navigation, rechercher

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

Propriétés

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

Description

TVarRec est utilisé dans une fonction dotée d'un paramètre tableau non typé.

Le type TVarRec est utilisé à l'intérieur d'une fonction avec un type de paramètre de tableau de valeurs const dans Delphi. Dans Delphi, le compilateur traduit automatiquement chaque élément du tableau en une valeur TVarRec. Dans C++, le paramètre de la fonction apparaît sous la forme d'un tableau de valeurs TVarRec.

Utilisez TVarRec pour manipuler des éléments individuels du tableau lors de l'implémentation de la fonction possédant un tableau de paramètres const.

Le champ VType indique le type simple de chaque valeur TVarRec. Les constantes de type variable représentent les valeurs transmises dans l'indicateur de la structure TVarRec. Ces constantes, énumérées ci-après, sont définies dans l'unité System.

Constantes Delphi :



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;



Constantes C++ :



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;



Remarque :  Dans C++, vous pouvez créer un tableau de valeurs TVarRec en utilisant la macro ARRAYOFCONST, définie dans sysopen.h.