Documentation GOSUB quick help

Apr 2, 2011
1,216
2
51
North Carolina, USA
TCMD version 13 -

[D:\]gosub /?
Execute a subroutine in the current batch file.
GOSUB ["filename"] label [args]
[D:\]

Since it allows a "filename" now - it might be worth changing the help to reflect it....
 
May 24, 2010
855
0
Northlake, Il
And just to be a stickler about it, the word "current" isn't accurate, either.

And the phrase "another part of the batch file" is no longer accurate, either, both because it could be another part of another batch file and since a subroutine can call itself (up to 22 levels "deep" in TCC 13.04.61) the phrase "another part" isn't accurate, either.
 

rconn

Administrator
Staff member
May 14, 2008
10,933
97
I believe Charles is saying that "Execute a subroutine in the current batch file" is not a good summary of what GOSUB does since the subroutine need not be in the current batch file.
The existing description is technically accurate, because the subroutine is executing in the context of the current batch file. But I'll reword it a bit so as to remove the potential confusion.
 
Apr 2, 2011
1,216
2
51
North Carolina, USA
Sorry for my delayed reply but David was / is correct in what I meant. And thank you Rex too.