![]() |
Delphi-Version: 10.4 Sydney
RttiRecordType und RTttiArrayType
Hi
2 Fragen zur Delphi Hilfe in ![]() steht Zitat:
und 2.: Wieso wird "System.Rtti.TRttiArrayType" direkt von "System.Rtti.TRttiType" abgeleitet und nicht auch von "System.Rtti.TRttiStructuredType" obwohl laut der Doku von "System.Rtti.TRttiStructuredType" Zitat:
Vieleicht hat ja jemand ne gute Erklärung. Charly |
AW: RttiRecordType und RTttiArrayType
1: Es ist sozusagen das Gleiche?
Klasse ist die Definition Objekt ist die Instanz der Klasse (das was aus dem create raus kommt) 2: War jemals alles im Delphi logisch? Nja, TRttiStructuredType sind Typen, welche unterschiedliche (strukturiert) und sogar keine untergeordneten Typen enthalten kann und TRttiArrayType enthält nur einen untergeordneten Typ und das mehrmals. |
AW: RttiRecordType und RTttiArrayType
Danke,
aber schon das nächste was ich nicht verstehe. Es geht um Delphi 10.4
Delphi-Quellcode:
Wo ist das "end;" zu "TValueData = record" ?
TValueData = record <--------------------------- steht in System.Rtti.pas bei Zeile 48
FTypeInfo: PTypeInfo; // FValueData vs old FHeapData: // FHeapData doubled as storage for interfaces. However, that was ambiguous // in the case of nil interface values: FTypeInfo couldn't be trusted // because it looked like the structure was uninitialized. Then, DataSize // would be 0. // FValueData is different: interfaces are always stored like strings etc., // as a reference stored in a blob on the heap. FValueData: IValueData; case Integer of 0: (FAsUByte: Byte); 1: (FAsUWord: Word); 2: (FAsULong: Cardinal); 3: (FAsObject: Pointer); 4: (FAsClass: TClass); 5: (FAsSByte: ShortInt); 6: (FAsSWord: SmallInt); 7: (FAsSLong: Integer); 8: (FAsSingle: Single); 9: (FAsDouble: Double); 10: (FAsExtended: Extended); 11: (FAsComp: Comp); 12: (FAsCurr: Currency); 13: (FAsUInt64: UInt64); 14: (FAsSInt64: Int64); 15: (FAsMethod: TMethod); 16: (FAsPointer: Pointer); end; [HPPGEN(HPPGenAttribute.mkNonPackage)] TValue = record Charly |
AW: RttiRecordType und RTttiArrayType
Hat sich geklärt,
"case integer of" hat KEIN eigenes end. Mein Editor hat gelogen und das "end" vom record als "end" vom case angezeigt. charly |
AW: RttiRecordType und RTttiArrayType
Das hat aber nichts mit der RTTI zu zu tun.
Er lügt nicht. Das END gehört zum RECORD und CASE hat hier kein END. Und es ist/war leider schon immer so, seit vielen Jahrzehnten. :wall: Der variante Record-Part hat kein Ende. ![]() Blöd, denn so kann man Ihn nicht in der Mitte haben (nachfolgend noch invariante Felder ... die muß man also mit in den varianten Teil reinschieben) und mehrere variante Teile sind auch nicht möglich, so wie z.B. in C++, wenn man verzweifelt versucht Header zu übersetzen. Und ja, es sieht blöd aus, macht garkeinen Spaß, ist absolut unverständlich und lässt sich beschissen in der Codeformatierung unterbringen. (zwei mal nach rechts und nur einmal doppelt nach links) |
AW: RttiRecordType und RTttiArrayType
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:29 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz