Ich hab mir vor einiger Weile mal eine Funktion geschrieben, die ein
Array of Const "lesbar" macht.
Evtl. hilft dir das
Delphi-Quellcode:
class function TCODDBHelperClass.ArrayToString(Arr: Array of Const): String;
var
Loop : Integer;
Value : TVarRec;
begin
Result := '[';
for Loop := 1 to Length(Arr) do
begin
Value := Arr[Loop - 1];
case Value.VType of
vtInteger : Result := Result + IntToStr(Value.VInteger);
vtBoolean : Result := Result + BoolToStr(Value.VBoolean);
vtChar : Result := Result + Value.VChar;
vtExtended : Result := Result + FloatToStr(Value.VExtended^); // '_EXTENDED_';
vtString : Result := Result + '''' + Value.VString^ + '''';
vtPointer : Result := Result + Format('%p', [Value.VPointer]);
vtPChar : Result := Result + '''' + Value.VPChar + '''';
vtObject : Result := Result + '_OBJECT_';
vtAnsiString : Result := Result + '''' + String(Value.VAnsiString) + '''';
vtCurrency : Result := Result + CurrToStr(Value.VCurrency^); //'_CURRENCY_';
vtVariant : Result := Result + Value.VVariant^;
vtWideString : Result := Result + '''' + WideString(Value.VWideString) + '''';
vtInt64 : Result := Result + IntToStr(Int64(Value.VInt64));
else
Result := Result + '_UNKNOWN_';
end;
if (Loop < Length(Arr)) then Result := Result + ', ';
end;
Result := Result + ']';
end;