Find attached a ported version of my calendrical calculations class.
Rename resource.txt to resource.rc
Rename calendar.ico.txt to calendar.ico
Put cCalendar.bi somewhere and update cCalendar.bas INCLUDE.
I updated Tiko and put resource.rc as a command line argument.
cCalendar.bas has default locations for all the timezones. You can change those locations to customize to your locale.
Congratulations. I can't test it right now because I'm too busy and your code deserves the right attention.
Ome small observation: With the latest versions of FreeBasic, it is no longer necessary to use '#CONSOLE ON / '#CONSOLE OFF pr '#RESOURCE resource.rc.
Now I'm using cmdline, i.e.
#cmdline "-s console" ' console application
#cmdline "-s gui" ' gui application
#cmdline "resource.rc" ' resource file
Thank you for the heads up on cmdline. I didn't know about that and it works nicely. I uploaded my work with the goal in mind to learn more about best practices I can use going forward.
If you ever need to use unicode strings, just change AS STRING to AS DWSTRING. AfxNova is fully Unicode, so you're already using Unicode without knowing it. This is because DWSTRING does the conversions automatically and works transparently with all the intrinsic functions and operators of FreeBasic.
Good point Jose. I'll start with taking my cCalendar class and replacing all STRING with DWSTRING.
All FB STRING declarations replaced with DWSTRING. Everything works as expected.
I only use STRING when I need to store binary data that can contain embeded nulls. DWSTRING extends WSTRING and has a BYREF CONST AS WSTRING cast that makes FreeBasic to believe that it is working with a WSTRING, so all the FreeBasic's intrinsic functions and operators accept it. It also uses the same structure of its descriptor as STRING to make STRPTR to work with it.