I have to do some conversions for color because it uses the RGB statement like in PowerBASIC. Once I come up with a standard way to convert the RGB (100, 100, 10) to the values of color between 0 and 1 that SmartBASIC uses, I will post that in the library section as it will be a library function that you can call to do the conversions. Will help others when they encounter the same statements that use the RGB zero through 255 instead.
It has key statements and this will give me the opportunity to try the ON GOTO or the ON GOSUB to replace the key statements that have a lot of code attached to them.
Henko wrote: ↑Wed May 15, 2019 9:43 pmI would not do the error handling (printing a message) within the function, but only do the error checking and leave the handling to the calling program.
An obvious case : when the program is in the graphics mode, you will not have an error message.
Some of the examples given simply return an empty string in case of error. That seems the right thing.