Versions of ECHO and PAUSE that can be turned on and off for development and debugging purposes.
I would not just add switches, etc., to those commands, because having TEST in front of the name will make its purpose very obvious.
I do realize these could be done with aliases, IF {condition} GOTO {a label past a group of ECHO commands}, etc.
I also realize that the IDE provides a much richer environment.
That being said ...
Often "some minor bug" shows up or you just want to see if a bunch of SET commands are setting variables properly, or you want to pause after certain commands/subroutines to see output, etc. Of course, a quick method when coding is to just add temporary ECHO or PAUSE commands.
These would work this way:
TESTPAUSE /OFF -- disables all TESTPAUSE commands
TESTPAUSE /ON -- activates TESTPAUSE
Default is TESTPAUSE /OFF
Same for TESTECHO
Usage:
TESTPAUSE /ON
TESTECHO /ON
SET MyVar=%filename
GOSUB MySubrou
TESTPAUSE
TESTECHO MyVar: %MyVar
TESTPAUSE /OFF
SET filename=NO MORE FILES
TESTECHO %filename
TESTECHO /OFF
I would not just add switches, etc., to those commands, because having TEST in front of the name will make its purpose very obvious.
I do realize these could be done with aliases, IF {condition} GOTO {a label past a group of ECHO commands}, etc.
I also realize that the IDE provides a much richer environment.
That being said ...
Often "some minor bug" shows up or you just want to see if a bunch of SET commands are setting variables properly, or you want to pause after certain commands/subroutines to see output, etc. Of course, a quick method when coding is to just add temporary ECHO or PAUSE commands.
These would work this way:
TESTPAUSE /OFF -- disables all TESTPAUSE commands
TESTPAUSE /ON -- activates TESTPAUSE
Default is TESTPAUSE /OFF
Same for TESTECHO
Usage:
TESTPAUSE /ON
TESTECHO /ON
SET MyVar=%filename
GOSUB MySubrou
TESTPAUSE
TESTECHO MyVar: %MyVar
TESTPAUSE /OFF
SET filename=NO MORE FILES
TESTECHO %filename
TESTECHO /OFF
Last edited: