PxPlus User Forum

Main Board => Discussions => Wish List => Topic started by: Thomas Bock on July 13, 2018, 04:36:26 AM

Title: gosub SOMEWHERE with a$=b$
Post by: Thomas Bock on July 13, 2018, 04:36:26 AM
I'd like to have a$ implicitly structured like b$ (iol and xfa) when passed to the subroutine.
This would avoid sequences like the following and put more focus on what to do rather than having to deal with the technical background. Perhaps the syntax can be tweaked for this.

local dim workAddr$ : iol(addr1$)
workAddr$ = addr1$
gosub ADDR_2_FILE
workAddr$ = addr2$
gosub ADDR_2_FILE
Title: Re: gosub SOMEWHERE with a$=b$
Post by: James Zukowski on July 13, 2018, 09:37:49 AM
You can pretty much already do that with a CALL into the current program:

CALL pgn+";routine_name",addrx$
Title: Re: gosub SOMEWHERE with a$=b$
Post by: Thomas Bock on July 16, 2018, 01:37:29 AM
You're right for that simple example. But a call is much slower than a gosub. And in legacy code there is often a need to access much environment data as well. So a gosub is still the first choice.