瀏覽代碼

New types in the ToString function of TValue record.

Henrique Gottardi Werlang 1 年之前
父節點
當前提交
5042c69e56
共有 1 個文件被更改,包括 5 次插入0 次删除
  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;