瀏覽代碼

+ add utility functions to get TValue values for Single, Double, Extended, Comp and Currency

git-svn-id: trunk@40662 -
svenbarth 6 年之前
父節點
當前提交
0d09c3c124
共有 1 個文件被更改,包括 26 次插入0 次删除
  1. 26 0
      packages/rtl-objpas/tests/tests.rtti.invoke.pas

+ 26 - 0
packages/rtl-objpas/tests/tests.rtti.invoke.pas

@@ -1455,6 +1455,32 @@ begin
   Result := TValue.{$ifdef fpc}specialize{$endif}From<ShortString>(aValue);
 end;
 
+function GetSingleValue(aValue: Single): TValue;
+begin
+  Result := TValue.{$ifdef fpc}specialize{$endif}From<Single>(aValue);
+end;
+
+function GetDoubleValue(aValue: Double): TValue;
+begin
+  Result := TValue.{$ifdef fpc}specialize{$endif}From<Double>(aValue);
+end;
+
+function GetExtendedValue(aValue: Extended): TValue;
+begin
+  Result := TValue.{$ifdef fpc}specialize{$endif}From<Extended>(aValue);
+end;
+
+function GetCompValue(aValue: Comp): TValue;
+begin
+  Result := TValue.{$ifdef fpc}specialize{$endif}From<Comp>(aValue);
+end;
+
+function GetCurrencyValue(aValue: Currency): TValue;
+begin
+  Result := TValue.{$ifdef fpc}specialize{$endif}From<Currency>(aValue);
+end;
+
+
 {$ifdef fpc}
 function GetArray(const aArg: array of SizeInt): TValue;
 begin