embedded FUNCTION/SUB
Posted: Thu Aug 06, 2020 12:01 pm
BasicChip - mornin'
Ran into an issue with a FUNCTION(or a SUB) inside a SUB - is it legal??
"I was hoping to keep everything in the SUB task3 - so it could be transferred easily"
'
the following statements would imply [to me] that it is possible
'
Help File re: SUB says this"
Code labels for goto/gosub declared within the SUB procedure are also in the local scope. "
[am I misinterpreting 'Code labels for goto/gosub declared within '??]
Help File re: FUNCTION
"FUNCTIONs are an extension of SUB that will return a value. "
'
BTW if I move the FUNCTION outside of the SUB it works
' and the 'GOTO work3 will jump over some following code.
Thanks for clarifying this - Gary
Ran into an issue with a FUNCTION(or a SUB) inside a SUB - is it legal??
"I was hoping to keep everything in the SUB task3 - so it could be transferred easily"
'
the following statements would imply [to me] that it is possible
'
Help File re: SUB says this"
Code labels for goto/gosub declared within the SUB procedure are also in the local scope. "
[am I misinterpreting 'Code labels for goto/gosub declared within '??]
Help File re: FUNCTION
"FUNCTIONs are an extension of SUB that will return a value. "
'
BTW if I move the FUNCTION outside of the SUB it works
' and the 'GOTO work3 will jump over some following code.
Thanks for clarifying this - Gary