I am in the process of converting a desktop app to iOS. I am finding that emulating some of the missing functions is the fastest way to convert but I’m having a problem with date.constructors. The desktop version allows dim d as new date(olddate) or dim d as date = new date (olddate) to duplicate a date - but the constructor is not available in iOS.
So by extending I try to create a new constructor
Sub constructor(extends d as date, copyDate as date)
d.Constructor(copyDate.SecondsFrom1970, copyDate.TimeZone)
End Sub
…but I just get the message: “There is more than one item with this name and it is not clear to which this refers.”
Then you have to remember to use YOUR date not the system one
Why not rename it “clone” or “copyOf” or something like that (which is more descriptive of what you’re actually doing)
Then do
Function Clone(extends d as Xojo.core.date) as Xojo.core.date
return new xojo.core.date(d.SecondsFrom1970, d.TimeZone)
End Sub