Browse Source

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

git-svn-id: trunk@40662 -
svenbarth 6 years ago
parent
commit
0d09c3c124
1 changed files with 26 additions and 0 deletions
  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);
   Result := TValue.{$ifdef fpc}specialize{$endif}From<ShortString>(aValue);
 end;
 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}
 {$ifdef fpc}
 function GetArray(const aArg: array of SizeInt): TValue;
 function GetArray(const aArg: array of SizeInt): TValue;
 begin
 begin