I had originally been returning the amended string from the FUNCTION using RETURN, which is no longer necessary when using BYREF.
I had deleted the RETURNed result from my code, but I forgot that I had declared the function AS STRING, which Boriel quickly spotted.
I needed to delete that from the end of the FUNCTION declaration, since I was no longer returning anything. Once that was done the code was stable.
To avoid this error condition I presume a compiler check is needed for FUNCTION type declarations when nothing is being RETURNed. Perhaps it should require such a FUNCTION to be changed to a SUB instead. I've done this in my code since I noticed the compiler was defaulting the FUNCTION type to float when the declaration was removed.
I had deleted the RETURNed result from my code, but I forgot that I had declared the function AS STRING, which Boriel quickly spotted.
I needed to delete that from the end of the FUNCTION declaration, since I was no longer returning anything. Once that was done the code was stable.
To avoid this error condition I presume a compiler check is needed for FUNCTION type declarations when nothing is being RETURNed. Perhaps it should require such a FUNCTION to be changed to a SUB instead. I've done this in my code since I noticed the compiler was defaulting the FUNCTION type to float when the declaration was removed.