Browse Source

New types in the ToString function of TValue record.

Henrique Gottardi Werlang 1 year ago
parent
commit
5042c69e56
1 changed files with 5 additions and 0 deletions
  1. 5 0
      packages/rtl/src/rtti.pas

+ 5 - 0
packages/rtl/src/rtti.pas

@@ -1130,10 +1130,15 @@ end;
 
 function TValue.ToString: String;
 begin
+  if IsEmpty then
+    Exit('(empty)');
+
   case Kind of
     tkString: Result := AsString;
     tkInteger: Result := IntToStr(AsNativeInt);
     tkBool: Result := BoolToStr(AsBoolean, True);
+    tkClass: Result := AsObject.ClassName;
+    tkClassRef: Result := AsClass.ClassName;
   else
     Result := '';
   end;