- Oct
- 364
- 17
i would like to see SUB ... ENDSUB
This doesn't have to be some substantial new functionality, it could basically be the same as GOSUB {LABEL}. ENDSUB could have the same functionality as RETURN without an argument.
This would basically be to make code more readable and more in line with other languages such as Excel VBA. it also would make it easier to distinguish GOTO target labels from GOSUB labels.
I would suggest that anything after ENDSUB be ignored--I normally would want to have the name of the sub, e.g.
Related possibilities would be that a SUB command on a line by itself will display a list of all SUB routines, and/or within a SUB the command SUB on a line by itself will display the name of the current SUB (for development/troubleshooting purposes).
Alternatively, SUB by itself within a SUB could list all SUBs but have some indicator of the current SUB such as ***.
Related to that SUB /P could display the name and then PAUSE.
This doesn't have to be some substantial new functionality, it could basically be the same as GOSUB {LABEL}. ENDSUB could have the same functionality as RETURN without an argument.
This would basically be to make code more readable and more in line with other languages such as Excel VBA. it also would make it easier to distinguish GOTO target labels from GOSUB labels.
I would suggest that anything after ENDSUB be ignored--I normally would want to have the name of the sub, e.g.
Code:
GOSUB DISPLAY_DATE
SUB DISPLAY_DATE
ECHO %_date
PAUSE
ENDSUB DISPLAY_DATE
Related possibilities would be that a SUB command on a line by itself will display a list of all SUB routines, and/or within a SUB the command SUB on a line by itself will display the name of the current SUB (for development/troubleshooting purposes).
Alternatively, SUB by itself within a SUB could list all SUBs but have some indicator of the current SUB such as ***.
Related to that SUB /P could display the name and then PAUSE.