Hi
I'm sure and agree about not so good practice to try to pass a string as value and not as reference.
If we see at wiki page of ByVal it says that STRING must be passed as reference.
About recursion and stack issue I partially agree because it is real the limit of the stack of memory, but the same is for dynamic arrays
in this case the coder must set a limit to the expansion of the size of the memory used for the task.
However I have used so little times the passing by value and now I'm discovering how QB64 manages it.
And my philosophycal question is: is it the same in QB45?
As soon I have just a little time I'll test and I'll report here the results.
Thanks for feedbacks
PS How to find the () argument about passing by value in the wiki? I am not so clever with setting search in database!
I think, strings and entire arrays are always passed by reference no matter what.
It seems logic to me, think of passing a big string or array, maybe with 1000s of chars or elements, by value? - Wouldn't it in worst case not simply blow up the stack (stackoverflow), especially if done so in many nested SUB/FUNCs or even in a recursivly called function?
I've no idea how much stack space is available for a program assigned by the OS at startup time of a program, nor I know if there is some mechanism which can automatically increase the stack size at runtime if required.