. Ŀ BATDEBUG V1.4 ; Armin Mueller Scheffelstr. 33; D-79102 Freiburg/Germany Internet: amueller@sun2.ruf.uni-freiburg.de Since the use of BATDEBUG is very straitforeward this text will concentrate on the use of the debugging features only. All what is in this file you may also find using the help-function [F1]. You are strongly invited to go on a tutorial journey through BATDEBUG by typing "START" at the DOS-prompt. This program has a similar layout and user access like most of the more recent programs which conform to the SAA-Standard. Most functions are accessible both through a drop-down menu system and by means of hotkeys. Whenever you highlight a menu-option a short one-line description of the function is given in the status-line. You get more verbose help whenever you press the F1-key at your keyboard. BATDEBUG was tested to function on every compatible PC XT/AT. However the author is not relieable for any bugs or mistakes which may cause any harm to you or your system. BATDEBUG is freely distributable and uploads to any BBS or software repository is greatly encouraged. Some of the more advanced functions of batdebug will be disabled after some time of use. This is indicated at the Titleline above the top-menu. You are encouraged to pay a small registration fee to the author to get the most recent version of BATDEBUG which will keep it's functionality for ever. To register you should use the registration-form which is accessible through the HELP-HOW TO REGISTER Menu. You may also read the Shareware information at the end of this file. BATDEBUG comes without real documentation. This means the documentation is contained in the context sensitive help. If you select any function from the menu, simply press the F1 key and you will get some help about this function, in most cases. You may also invoke an external help program concerning topics of the batch language. FILES: The Distribution package of BATDEBUG consists of the following files: START BAT ........ A batch file to start the Tutorial TUTOR1 BAT ........ Four tutorial Batch-files which are loaded TUTOR2 BAT into BATDEBUG by the start.bat. You may follow TUTOR3 BAT the instructions in these files to have a short TUTOR4 BAT journey through the features of BATDEBUG BATDEBUG EXE ........ The BATDEBUG executeable BATDEBUG HLP ........ The online help database BATDEBUG DOC ........ Short documentation The integrated Debugger of BATDEBUG has two different Menus: Debug and Run. When you have written or loaded a batch file in the editor you can test it's behaviour with the RUN-Menu. RUN Menu Shortkey: [Alt]-[R] This Menu allows you to execute your Batch-File entirely or step by step to examine it's behaviour. RUN FROM START Shotkey: [Crtl]-[F9] This will run your entire Batch-file from start to end as it would execute without the debugger. Afterwards you will find yourself back in the debugger. You can examine the last output of the run by pressing [Alt]-[F5]. Please do not load any TSRs (Terminate and Stay Resident) in the Batch-File except there is a command to deinstall the TSR and this command is also given in the Batch-File. Tip: If there are UMB's installed at your computer (refer to DOS-Manual) than you may load the TSR high with the LH or LOADHIGH command. In this case the TSR will not interfere with the debugger. RUN TO CURSOR Shortkey: [F4] This will run your Batch-File from the start to the line above the cursor in successive steps. Never load a TSR in your Batch-File! But you may use a TSR if it is successfully loaded HIGH into available UMB's. RUN INTO Shortkey: [F7] This will execute the line at the cursor. There are the following differences to executing the line by the EXECUTE LINE command. a) If there is a call to another Batch-File on that line, this Batch-File will be loaded into the editor and execution stops at it's first line. When you have executed the last line of this new file, the debugger will bring you back to the next line in the file you have been before. b) BATDEBUG will recognise an errorlevel if the command executed in this line returns one, this errorlevel will be considered by BATDEBUG if there is a IF ERRORLEVEL ... statement in the next lines. c) BATDEBUG is able to read the stream of data flowing through a pipe ("|") which connects the output of one program to the input of another program. The data passing through a pipe is placed in an edit-window for examination under the titel PIPE.# where # is the number of the pipesymbol ("|") in the current line, counting from left to right. If you want to use these data lateron, save them to file before you close the window. Step into [F7] should only been used if you need the aformentioned functionalities. The normal way of executing your batchfile is with the EXECUTE LINE command [F8]. EXECUTE LINE Shortkey: [F8] This will blindly execute the line at the cursor and advance cursor to the next line. You can view the output of the command by pressing [Alt]-[F5]. If there is a call to another BATCH-file in this line, this BATCH-file is executed completely in one step. If there are pipes connecting Programs in the current line, the data flowing through this pipes are not examined. Note that errorlevels are not taken into account ! DEBUG Menu [Alt]-[D] This menu gives you information about some Parameters related to your Program. SHOW ENVIRONMENT This gives you a list of the current content of the DOS-Environment. Note that this is not the real Environment but something the debugger extracts from it's own environment and the SET-Commands already executed in your Program. All Batches loaded to the Debugger act on the same environment, whereas every BATCH-file in the Debugger has his own list of parameters. In the registered Version of BATDEBUG you may delete, add or edit every environment-variable. SHOW PARAMETER DEBUG MENU:debug_menu This gives you a list of the command-line-options or parameters of your Batch-File. Note that the first parameter in this list is the Name of the program-file itself and may be referenced in the batchfile with %0. For now there you can see the full path, but under real condition there is the userinput which invoked the program. So if there is: C:\BATCH\TEST.BAT under BATDEBUG there will most propably stand just "test" when your batch is running standalone. There is no limit to the number of commandline parameters as long as the commandline does not exeed 128 letters. You may add, delete or edit any of the parameters. SHOW USERSCREEN [Alt]-[F5] Shows you the output of the last command, if any. Pressing any key will get you back to the editor. EVALUATE COMMAND [Crtl]-[F4] This shows you the current line, all variables substituted with their current value. This is most usefull to examine a command before aktually executing it. SHOW MEMORY This window shows some memory related informations, the errorlevel of the last command if it was started with step into [F7] and the current size of the environment. ENVIRONMENT: Before you start your batchfile make shure there is enough space for all the environment variables you define in the batchfile. The environment space is set in the CONFIG.SYS file with the SHELL command. If the Batchfile runs under ms-windows 3.x, the maximum environment size is determined by the COMMANDENVSIZE statement of the SYSTEM.INI. EDITOR: Two numbers representing the amount of memory used by all files currently loaded into editorwindows and the maximum amount of memory available for new files. MEMORY: The amount of memory available to BATDEBUG for it's own operations. You may find out about the amount of memory available to Programs executed from BATDEBUG by writing the command MEM into a new line of the editor and pressing the F8 key. The output of this command may be examined with the [Alt]-[F5] key combination. HELP Context sensitive help is available in most situations and on most topics by pressing the F1 key. HELP on DOS command When the Ctrl-F1 key combination is pressed, BATDEBUG tries to invoke the DOS help system. For this it tries to call a program with the name HELP and passes the word at the current cursor position as the first parameter to it. This makes any customized help system available to the user. Note, if you use MS-DOS 5.0 and before, the output of the builtin help is immediately hidden by the Editor. You can view the output by the SHOW USERSCREEN command. About BATDEBUG Help Menu:help_menu Some sparse basic information about the program, my address and if you haven't registered jet the information that this program is shareware. Feel free to send any comments, bug reports and suggestions to me. You may also consider to encourage the progress of this program by register your version of BATDEBUG. Please register Batdebug ! BATDEBUG is shareware. For transmittance of $30.- as note/cheque or per registered post to the author you will receive a new version of BATDEBUG without the shareware reminders and with enhanced functionality. The functions which get disabled in the shareware version are: - Manipulation of the Environment, - printout, - analysis of the datastream though Pipes and - closing of all windows in one step. Address of the author: Armin Mller Scheffelstr. 33 D-79102 Freiburg/Brsg Germany T.:0761/706664 On Shareware: Shareware is a form of marketing, which has found some propagation in the software branch. It offers many advantages for authors and users, but also entitles the credibility of both parties. A shareware program is brought into circulation by the author asking you: A) To give the program farther away to friends, foes, Mailboxen, FTP-Archive, distributors in short anywhere and to make it accessible to a lot of potential users. B) To pay a duty for the program, as it is said, to register it when it fits your needs. The advantages for the user are, that he can test the program to for its capability before he is obliged to pay something. The advantage for the author is the relatively low outlay. It is understandable, that the author only then is encouraged to develope the program further or make new programs publicly available when a pleasant high number of registrations are send to him. Else he will probably soon abide the not insignificant extra work, to document his program, write a user-guide and take care for a broad distribution. It is in your own interest, to pay for a program even if you use it only now and then. How to register is explained in HELP - HOW TO REGISTER. DISCLAIMER: The author has no responsibility or liability for the functionality of the programme and for any harms which may arise from its use.