PlanetSquires Forums

Support Forums => José Roca Software => Topic started by: Richard Kelly on April 29, 2026, 02:50:46 PM

Title: Proof of Concept Tiko and AFXNova
Post by: Richard Kelly on April 29, 2026, 02:50:46 PM
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.

Title: Re: Proof of Concept Tiko and AFXNova
Post by: José Roca on April 29, 2026, 03:29:21 PM
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


Title: Re: Proof of Concept Tiko and AFXNova
Post by: Richard Kelly on April 29, 2026, 04:15:52 PM
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.
Title: Re: Proof of Concept Tiko and AFXNova
Post by: José Roca on April 29, 2026, 04:33:19 PM
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.
Title: Re: Proof of Concept Tiko and AFXNova
Post by: Richard Kelly on April 29, 2026, 08:53:58 PM
Good point Jose. I'll start with taking my cCalendar class and replacing all STRING with DWSTRING.
Title: Re: Proof of Concept Tiko and AFXNova
Post by: Richard Kelly on April 29, 2026, 09:31:15 PM
All FB STRING declarations replaced with DWSTRING. Everything works as expected.
Title: Re: Proof of Concept Tiko and AFXNova
Post by: José Roca on April 30, 2026, 01:23:53 AM
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.