Tried to use DateDiff which is part of Microsoft VisualBasic namespace but that seems to be missing in Mercury.
Are you working in .net?
In VS it says unknown identifier Datediff and in water says the same thing.
DateDiff is not part of .NET Core if you’re using that. You have to add a reference to Microsoft.VisualBasic.
The fully qualified name is:
Microsoft.VisualBasic.DateAndTime.DateDiff
No, I meant a .net framework or .Net core project.
In the .Net (Core) targets, we just use the Microsoft.Visual.Basic.dll
In all other targets, this Dll is not available, so we implemented it in the Mercury.dll.
But - at this moment - the DateAndTime part in Mercury.dll is not operational yet.
This means that this VB functionality is only available for .Net (core) targets at this moment.
But we are working on this.
Thanks for the info. I am having a blast kicking the tires on Mercury! I like what I see so far and the execution speeds from the executables are impressive.
I hope this will become my new home for my apps. I desperately want to avoid the land of the semicolons and curly braces. Not that I cant, I think they are ugly!
May I quote you on twitter? (no name of course)
Absolutely! Here is another…
How sophisticated is your compiler when it cannot determine where the end of a line is without a ; c# has been around 20 years and still cannot tell where the end of the line is. VB was able to do that from the beginning.
a link to .net core documentation about datediff. Keep up the good work.
I’m very happy to hear that!
FWIW, Mercury Base Library is open source and available on GitHub, here: http://github.com/remobjects/MercuryBaseLibrary/ Contributions are extremely welcome.
Our goal is to, on .NET, defer to the existing Microsoft.VisualBasic.dll where possible, with Mercury.dll only adding additional “similarly VB-specific” functionality, while fir the other platforms, the MBL will replicate (a strategic/useful subset) of Raif functionality, as clean pure-Elements implementations.
Side note: you will need to sue Fire or Water to work on MBL, as it uses our new-ish Multi-Target project format (where one project can build for many/all platforms), which is not and probably will to be supported in Visual Studio.
I am targeting linux using water and mercury and am trying to do simple time math. (EndTime - StartTime) Where all times are DateTime.Now.Utc.Now . What is the supported way of doing this inside of mercury without external references?
use Elements RTL and it’s DateTime class, I’d say.