Sign in Join
Wiki copytemporary

TVarRec: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: TVarRec

OldNewLine
1+Back to [[Data type|data types]].
2+
3+A **TVarRec** is a [[variant record]] used with the [[Const|array of const]] parameter declaration. The VType member is checked by the user to determine which data type is stored in the record.
4+
5+``` pascal
6+ TVarRec = record
7+ case VType : sizeint of
8+{$ifdef ENDIAN_BIG}
9+ vtInteger : ({$IFDEF CPU64}integerdummy1 : Longint;{$ENDIF CPU64}VInteger: Longint);
10+ vtBoolean : ({$IFDEF CPU64}booldummy : Longint;{$ENDIF CPU64}booldummy1,booldummy2,booldummy3: byte; VBoolean: Boolean);
11+ vtChar : ({$IFDEF CPU64}chardummy : Longint;{$ENDIF CPU64}chardummy1,chardummy2,chardummy3: byte; VChar: Char);
12+ vtWideChar : ({$IFDEF CPU64}widechardummy : Longint;{$ENDIF CPU64}wchardummy1,VWideChar: WideChar);
13+{$else ENDIAN_BIG}
14+ vtInteger : (VInteger: Longint);
15+ vtBoolean : (VBoolean: Boolean);
16+ vtChar : (VChar: Char);
17+ vtWideChar : (VWideChar: WideChar);
18+{$endif ENDIAN_BIG}
19+{$ifndef FPUNONE}
20+ vtExtended : (VExtended: PExtended);
21+{$endif}
22+ vtString : (VString: PShortString);
23+ vtPointer : (VPointer: Pointer);
24+ vtPChar : (VPChar: PAnsiChar);
25+ vtObject : (VObject: TObject);
26+ vtClass : (VClass: TClass);
27+ vtPWideChar : (VPWideChar: PWideChar);
28+ vtAnsiString : (VAnsiString: Pointer);
29+ vtCurrency : (VCurrency: PCurrency);
30+ vtVariant : (VVariant: PVariant);
31+ vtInterface : (VInterface: Pointer);
32+ vtWideString : (VWideString: Pointer);
33+ vtInt64 : (VInt64: PInt64);
34+ vtUnicodeString : (VUnicodeString: Pointer);
35+ vtQWord : (VQWord: PQWord);
36+ end;
37+```
38+
39+---
40+*From the Free Pascal wiki, page "TVarRec", as it stood on 2020-03-02 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history