As I’m porting an existing project to Oxygene, I’m using the DelphiRTL project to avoid reinventing the wheel.
I totally understand that it’s still a work in progress, which means it lacks a few methods that my code uses, such as these:
if not System.Math.IsNaN(DoubleValue) then Result := System.Ln(DoubleValue);
I know how to implement
Ln using regular CLR functions, but what I’m faced with is the way I should declare those functions so that I don’t have to change the code above.
I created a file called
System.pas and placed this code inside it:
namespace System; interface function Ln(const X: Double): Double; implementation function Ln(const X: Double): Double; begin result := System.Math.Log(X); end; end.
This made the error about missing
System.Ln go away. So I went on and created a
System.Math.pas file and placed this inside it
namespace System.Math; interface function IsNaN(d: Double): Boolean; implementation function IsNaN(d: Double): Boolean; begin Result := Double.IsNaN(d); end; end.
But this did not help, I still get the following error on the
if line above:
Error (E43) No static member "IsNaN" on type "Math"
And this despite having made sure
System.Math is in the uses section.
What am I missing?