As an exercise I’m playing with a DS3232 RTC and using FlexBASIC to read and write to the device via I2C. That part works nicely.
My problem comes when I’m formatting the returned data into a prettier human-readable form. In the process I’m calling a bunch of string handling functions and getting “Out Of Memory” errors immediately. So I increased the HEAPSIZE to 8k. But after 4-5 iterations of printing the date/time, (e.g “Mon Oct 14, 2019 20:34:56”) the problem recurs.
Is there a way to either manually trigger FlexBASIC’s garbage collection, or to maybe create/use/destroy/free a string variable repetitively in a loop to avoid the memory hogging?
The FlexBASIC docs for the NEW and DELETE methods re strings is pretty sparse, but I’ve tried various permutations of these with no success yet.