![]() |
fehlende VarTypes in D5
Hallo,
anscheinend kennt D5 nicht alle VarTypes (es geht um den Datentyp Variant). Deshalb musste ich in folgender Funktion schon nachhelfen:
Delphi-Quellcode:
Nun fehlen mir noch die Entsprechungen zu $13 und $1A.
function VarTypeAsString(const vt: Integer): string;
begin case vt and varTypeMask of varEmpty: Result := 'Empty'; varNull: Result := 'Null'; varSmallint: Result := 'SmallInt'; varInteger: Result := 'Integer'; varSingle: Result := 'Single'; varDouble: Result := 'Double'; varCurrency: Result := 'Currency'; varDate: Result := 'Date'; varOleStr: Result := 'OleStr'; varDispatch: Result := 'Dispatch'; varError: Result := 'Error'; varBoolean: Result := 'Boolean'; varVariant: Result := 'Variant'; varUnknown: Result := 'Unknown'; varString: Result := 'String'; varAny: Result := 'Any'; varByte: Result := 'Byte'; $0e: Result := 'Decimal (16Byte)'; $18: Result := 'void'; $1b: Result := 'safe-array'; $1d: Result := 'UserDef'; else Result := Format('0x%.8x',[vt]); end; if (vt and varArray) <> 0 then Result := 'array of ' + Result; if (vt and varByRef) <> 0 then Result := '*'+Result; end; Und was fehlt sonst noch? |
Re: fehlende VarTypes in D5
Hier mal die VarTypes aus der D7 Hilfe
Delphi-Syntax: const varEmpty = $0000; varNull = $0001; varSmallint = $0002; varInteger = $0003; varSingle = $0004; varDouble = $0005; varCurrency = $0006; varDate = $0007; varOleStr = $0008; varDispatch = $0009; varError = $000A; varBoolean = $000B; varVariant = $000C; varUnknown = $000D; varShortInt = $0010; varByte = $0011; varWord = $0012; varLongWord = $0013; varInt64 = $0014; varStrArg = $0048; varString = $0100; varAny = $0101; varTypeMask = $0FFF; varArray = $2000; varByRef = $4000; C++ Syntax: static const Shortint varEmpty = 0x0; static const Shortint varNull = 0x1; static const Shortint varSmallint = 0x2; static const Shortint varInteger = 0x3; static const Shortint varSingle = 0x4; static const Shortint varDouble = 0x5; static const Shortint varCurrency = 0x6; static const Shortint varDate = 0x7; static const Shortint varOleStr = 0x8; static const Shortint varDispatch = 0x9; static const Shortint varError = 0xa; static const Shortint varBoolean = 0xb; static const Shortint varVariant = 0xc; static const Shortint varUnknown = 0xd; static const Shortint varByte = 0x11; static const Shortint varStrArg = 0x48; static const Word varString = 0x100; static const Word varAny = 0x101; static const Word varTypeMask = 0xfff; static const Word varArray = 0x2000; static const Word varByRef = 0x4000; Schöne Grüße, Jens :hi: |
Re: fehlende VarTypes in D5
Zitat:
D7 ist da aber auch nicht vollständig. :-( meine Recherchen ergab: ![]()
Delphi-Quellcode:
const
varLongWord = $13; // VT_UI4 varDecimal = $0e; // VT_DECIMAL (16Byte) varVoid = $18; // VT_VOID varHResult = $19; // VT_HRESULT varPointer = $1a; // VT_PTR varSaveArray = $1b; // VT_SAFEARRAY varCarray = $1c; // VT_CARRAY varUserDefined = $1d; // VT_USERDEFINED varPChar = $1e; // VT_LPSTR varFileTime = $40; // VT_FILETIME varBlob = $41; // VT_BLOB varStream = $42; // VT_STREAM varStorage = $43; // VT_STORAGE varStreamedObj = $44; // VT_STREAMED_OBJECT varStoredObj = $45; // VT_STORED_OBJECT varBlobObj = $46; // VT_BLOB_OBJECT varClipbrdFormat = $47; // VT_CF varClsId = $48; // VT_CLSID |
Alle Zeitangaben in WEZ +1. Es ist jetzt 02: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