I believe it can, but makes no sense in that context because if a variable is global i can access it everytime without the need to return it from a sub.Can't a sub return an array ??
There is no restriction on this, because the return value is always a (single) object. So any type (even structures) will do...So the use of an array as return value would be the solution here.
This seems to be a design restriction of basic4ppc. Even user defined structures have to be globals. :sign0161:if there were not the caveat that every array has to be global in B4P.
I am afraid that this is not the case for the optimising compiler. Due to the way internal Subs are declared in optimised code "Return" can return only Value types i.e array elements such as "Array(2)" but not array references such as "Array()." It is possible for libraries to return Array/struct references that can be assigned to already "Dimmed" arrays but this is a special case.There is no restriction on this, because the return value is always a (single) object. So any type (even structures) will do...
Thanks for this additional info. Haven't realized that yet. :sign0161:I am afraid that this is not the case for the optimising compiler.
That's true, but in most "modern" languages the "one" result can be an object which contains several different information.I know of no computer language that can return more than one result from a function.