Purpose:Calls the Take Command IDE / batch debugger (IDE.EXE)

 

Format:BDEBUGGER [/C] batchfilename [parameters]

or

IDE [/C] file...

 

batchfilename

Full name of the batch file to debug.

parameters

Parameters for the batch file

file

File(s) to edit

 

/C(reate new batch file)

 

 

Usage:

 

BDEBUGGER and IDE open a development environment in which files can be edited and (in the case of batch files) debugged. The difference between the two commands is that BDEBUGGER assumes that you're trying to edit & debug a batch file. BDEBUGGER will add a missing .BTM, .CMD, or .BAT extension on the filename, and it assumes that any arguments following the batch file name are batch file parameters. The IDE command is intended as a generic file editor (it supports syntax colorization for several scripting languages, including .BAT, .BTM, and .CMD batch files, Perl, Python, Ruby, and Tcl). Each argument on the command line is assumed to be a filename to be opened in a separate tab window.

 

The IDE will select the syntax lexer (colorization) based on the file extension:

 

.bat TCMD (or CMD)
.btm TCMD
.cmd TCMD (or CMD)
.cssCSS
.htm HTML
.htmlHTML
.luaLua
.php PHP
.plPerl
.ps1PowerShell
.pyPython
.rbRuby
.shBash shell
.sqlSQL
.tclTcl/Tk
.vbsVBScript
.xmlXML

 

The BDEBUGGER / IDE window includes a slider control on the lower right corner of the status bar to control the transparency level.

 

If you are creating or debugging a TCC batch file, use the (default) TCC Syntax in the Options menu. If you are creating or debugging a batch file to run under CMD.EXE, select CMD Syntax.

 

The edit window toolbar (which is configurable by clicking on the rightmost down arrow), has a number of icons to control debugging. Each has a tooltip for quick reference:

 

NewCreate a new batch file in a new tab window.
OpenOpen an existing batch file in a new tab window.
SaveSave the current batch file.
PrintPrint the current batch file.
CutCopy the highlighted selection to the clipboard and delete it from the file.
Copy Copy the highlighted selection to the clipboard.
PasteCopy the contents of the clipboard to the current cursor location.
DeleteDelete the highlighted selection.
UndoUndo the last edit.
RedoRestore the last Undo.
FindSearch for text.
Batch ArgumentsNew batch file arguments. The text will be parsed into %1 - %n batch arguments and used when the batch file is debugged.
Start DebuggingStarts the debugger. The cursor will be placed on the first line.
Pause DebuggingPause execution at the next line.
Stop DebuggingStops the debugger.
Step IntoExecute the current line.
Step OverExecute the current line but disable the debugger during a CALL or GOSUB.
Run to BreakpointExecute the batch file, stopping at the next breakpoint.
Toggle BreakpointSets or turns off a breakpoint on the current line.
Clear BreakpointsClear all breakpoints in the current batch file.
File PropertiesDisplays information on the current batch file.
Start New ShellStart another copy of TCC (this is useful if you need to perform some tasks while debugging a file.)
HelpDisplay the online help.

 

You can get help for the currently selected (highlighted) command / variable / function by pressing Ctrl-F1, or right-clicking the mouse and selecting Help from the context menu.

 

Open will load the batch file and any associated breakpoint file (filename.ext.bp) and the watched variables file (filename.ext.watch).

 

Save will save the batch file and any associated breakpoint file (filename.ext.bp) and the watched variables file (filename.ext.watch).

 

If you press Ctrl-C or Ctrl-Break while debugging, you will see the prompt:

 

Cancel batch job filename (Y/N/A/D) :

 

Pressing D will return you to single-step mode in the debugger. (This allows you to interrupt a run-to-breakpoint without terminating the debugger and batch file.)

 

You can change the line to be executed next when in debugging mode by moving the caret to the line and either right clicking & selecting "Jump to This Line" or by pressing Ctrl-Shift-F11. Note that if you attempt to jump into or out of a DO loop or IFF block, bad things will happen!

 

Alt-F11 will invoke the Evaluate Expression dialog. Alt-Shift-F11 will invoke the Evaluate Expression dialog for the current selection, or if no text is selected, for the current line.

 

The Options menu also has a Profiler option. When the Profiler is on, it will display the elapsed time for each command line in the margin immediately to the left of the command line.

 

The batch IDE has a Toolbox window that lists all of the internal commands, variables, and variable functions organized by category. Double-clicking on a command will display its command dialog (if it has one), and then insert the resulting command on the current line in the editor. Selecting a command or variable and then pressing F1 will display the help for that command/variable.

 

The IDE includes tabbed windows to display and/or modify the breakpoint list, watch list, modified variables, aliases, batch variables, environment variables, and user functions. The variable windows also have a toolbar, with the following buttons:

 

NewRestore the original values for the list (alias, variable, environment, or function)
OpenAdd the contents of a file to the list
SaveSave the current list to a file
ResetReplace the original values with the modified list
PrintPrint the current list
CutCopy the highlighted selection to the clipboard and delete it from the file
Copy Copy the highlighted selection to the clipboard
PasteCopy the contents of the clipboard to the current cursor location
DeleteDelete the highlighted selection (or the character at the cursor location if no selection)
UndoUndo the last edit
RedoRestore the last Undo
FindSearch for text
HelpDisplay the online help

 

The environment variables window displays any variables changed since the last command in red. You can specify variables to exclude from the environment variable window with the DebugVariableExclude variable. For example, to suppress the display of the processor and user variables:

 

 set DebugVariableExclude=proc*;user*

 

Note that this option doesn't affect the existence of the variables, just whether they're displayed in the environment variable window.

 

The Modified variables window shows all variables that are created or modified while executing the batch file. (This is like the "Auto" window in Visual Studio.)

 

Breakpoints

 

You can set a breakpoint either through the menu, the toolbar, or by moving the mouse cursor to the left margin of a line and left-clicking. You can only set a breakpoint on an executable line (i.e., not on a blank line, comment, label, etc.),

 

You can define conditional breakpoints by specifying the number of iterations before the breakpoint is triggered, and/or define a conditional expression that must be true before the breakpoint is triggered. After setting the breakpoint, enter the conditions either by right-clicking on the breakpoint and selecting "Break >=" (to set the minimum number of iterations), or "Condition" (to set the conditional expression). You can also select the Breakpoint window and double-click on the "Break >=" or "Condition" columns to edit or modify the conditions.

 

You can temporarily disable a breakpoint (without deleting it) by right-clicking on the breakpoint and selecting "Enable/Disable Breakpoint". You can disable all breakpoints by clicking on the Debug menu and selecting "Disable All Breakpoints".

 

Watch Window

 

The Watch window allows you to monitor environment variables, internal variables, variable functions, and user-defined functions, or to pause execution when a specified condition is met. The Watch window appears at the bottom of the debugger window. Enter the variable name or expression in the left column; the debugger will automatically display the current value in the right column. You can also add a variable to the Watch window by selecting it in the main debugger window, then clicking the right mouse button and selecting "Add to Watch". If the string in the left column is a single argument, it is assumed to be a variable name. Otherwise, it is assumed to be an expression. Expressions can be anything that IF can evaluate; for example:

 

 %i = 3

 ERRORLEVEL GT 12

 

Note that expressions require variable names to be prefixed by a %. If you're entering a single variable argument to monitor, do not use a %.

 

If you right click on the first column in the Watch window, the debugger will display an environment variable listbox. Select an entry to have it added to the watch list.

 

When the value of a monitored variable changes, the Watch window will change the text color to red.

 

Margins

 

There are three possible margins on the left of the edit window:

 

The line number (selectable by the "Options / Display Line Numbers" menu option).

The Breakpoint margin (left click in this margin to set a breakpoint on this line).

The Fold margin (selectable by the "Options / Display Fold Margin" menu option), which will display a - for blocks that can be collapsed to a single line (DO, IFF, and SWITCH commands, and command groups). When a block is collapsed, the Fold margin will display a +. Left clicking in the Fold margin will toggle the fold state.

 

Edit Windows

 

The text processing commands available in the IDE edit windows are listed below. The text commands can be classified into general categories:

 

Onestep        Caret commands

Onestep        Edit commands

Onestep        Mark / Clipboard commands

Onestep        Search commands

Onestep        File commands

Onestep        Bookmark commands

Onestep        Breakpoint commands

Onestep        Expression evaluation commands

 

Caret commands

 

Right

This command will move the caret one character to the right. When the caret is on the last position of the current line it is moved to the first position of the next line.

Shift-Right

In addition to the caret movement this command will also extend the current selection to the new caret position.

Left

This command will move the caret one character to the left. When the caret is on the first position of the current line it is moved to the last position of the previous line.

Shift-Left

In addition to the caret movement, this will also extend the current selection to the new position.

Up

This command will move the caret one line up. The caret column position will be set as close to its previous column position as possible.

Shift-Up

In addition to the caret movement this command will also extend the current selection to the new position.

Down

This command will move the caret one line down. The caret column position will be set as close to it's previous column position as possible. When the caret is on the last line but not on the last column it will be moved to the last column.

Shift-Down

In addition to the caret movement this command will also extend the current selection to the new position.

End

This command will move the caret to the end of the line it is currently on. If the caret is already at the end nothing happens.

Shift-End

In addition to the caret movement this command will also extend the current selection to the new position.

Home

This command will move the caret to the start of the line it is currently on. If the caret is already at the start nothing happens.

Shift-Home

In addition to the caret movement this command will also extend the current selection to the new position.

Ctrl-Right

This command will move in one of the following ways:


When the caret is located on a delimiter character the caret is moved right until the first non-delimiter is found.


When the caret is located on a non-delimiter character the caret is moved to the next delimiter character.


When the caret is located on the last word or delimiter of the current line the caret is moved to the first word or delimiter of the next line.

Ctrl-Shift-Right

In addition to the caret movement this command will also extend the current selection to the new caret position.

Ctrl-Left

This command will move in one of the following ways:


When the caret is located on a delimiter character the caret is moved to the start of  the previous word.


When the caret is located on a non-delimiter character and not on a white-space character the caret is moved to the start of the current word.


When the caret is located on the start of the first word, delimiters or white-space of the current line the caret is moved to the start of the last word or delimiters of the previous line.

Ctrl-Shift-Left

In addition to the caret movement this command will also extend the current selection to the new position.

Ctrl-Home

This command will move the caret to the beginning of the text. When the caret is already at this location nothing happens.

Ctrl-Shift-Home

In addition to the caret movement this command will also extend the current selection to the new position.

Ctrl-End

This command will move the caret to the end of the text. When the caret is already at this location nothing happens.

Ctrl-Shift-End

In addition to the caret movement this command will also extend the current selection to the new position.

PgUp

This command will move the caret one view up when it is located on the top line currently in the view. When the caret is not located on the top line of the view, it will be  moved there.

Shift-PgUp

In addition to the caret movement this command will also extend the current selection to the new position.

PgDn

This command will move the caret one view down when it is located on the bottom line currently in the view. When the caret is not located on the bottom line of the view, it will be moved there.

Shift-PgDn

In addition to the caret movement, this command will also extend the current selection to the new position.

 

Edit commands

       

Ctrl-Z

This command will undo the last change made to the edit control contents. You can undo any number of changes made to the control contents up to the maximum number of undo/redo hops.

Ctrl-Y

This command will redo the last change you have undone. You can re-do any number of changes up to the number of changes undone.

Backspace

This command will remove the character to  the left of the caret. When the caret is located at the start of the line, the characters right of the caret are appended to the  previous line and the caret is moved to be positioned between the old line contents and the appended characters.

Delete

This command removes the character to the right of the caret. When there are no characters to the right of the caret, the contents of the next line is appended to the current line.

Return

This command will split the current line and create a new line of the characters, if any, right of the caret. The caret is moved to the start of the newly created line.

Ctrl-Delete

When the caret is located on a word, this command will delete all characters in the word right of the caret position.

Ctrl-Backspace

When the caret is located on a word, this command will delete all characters in the word left of the caret position.

Tab

This command does one of the two following things:


When there is a valid text selection, this command will indent the lines covered by the selection right by one tab-stop.


When there is no text selection, a tab is inserted at the current caret position.

Shift-Tab

When there is a valid text selection, this command will indent the lines covered by the selection left by one tab-stop.

Shift-Ctrl-U

When there is a valid selection, this command will convert all lower-case characters in the selection to upper-case characters. If there is no valid selection, nothing happens.

Ctrl-U

When there is a valid selection, this command will convert all upper-case characters in the selection to lower-case characters. If there is no valid selection, nothing happens.

Ins

This command will toggle the current editing mode between overwrite and insert.

                                 

Mark / Clipboard commands

 

Ctrl-A

This command will select all the text.

Ctrl-V

This command will, when there is text present in the clipboard, paste the clipboard contents at the current position.

Ctrl-C

This command will, when there is a selection, copy the selected text to the clipboard.

Ctrl-X

This command will, when there is a selection, copy the selected text to the clipboard and remove the selection from the text.

 

Search commands

 

Ctrl-F3

This command will find the next occurrence of the word under the caret. When the next occurrence is found, it is selected.

F3

This command will find the next occurrence of the current search pattern. When the search pattern is found, it is selected.

Shift-F3

This command will find the previous occurrence of the current search pattern. When the search pattern is found, it is selected.

Ctrl-G

This command will show the goto dialog.

Ctrl-F

This command will show the find dialog.

Ctrl-H

This command will show the replace dialog.

         

File commands

       

Ctrl-N

Open a new file in a new tab window.

Ctrl-O

Open an existing file in a new tab window.

Ctrl-W

Close all files.

Ctrl-S

This command will save the current file.

Ctrl-Shift-S

Save all files.

Ctrl-P

This command will open the print dialog.

Ctrl-I

Display the properties for the current file.

Alt-F4

Exit the debugger.

       

Bookmark commands

 

Ctrl-F2

This command will clear the bookmark on the current line if it is set, or set the bookmark if it is cleared.

Shift-Ctrl-F2

This command will clear all bookmarks.

F2

This command will place the caret on the next line which has a bookmark set. When there is no next line with a bookmark, the text is searched starting at the first line.

Shift-F2

This command will place the caret on the previous line which has a bookmark set. When there is no previous line with a bookmark, the text is searched from the last line up again.

 

Breakpoint commands

       

Ctrl-F9

This command will toggle a breakpoint on the current line.

Ctrl-Shift-F9

This command will clear all breakpoints.

 

Expression evaluation commands

       

Ctrl-F7

Regular expression analyzer

Alt-F11

Alt-Shift-F11

Invoke the Evaluate Expression dialog.

Invoke the Evaluate Expression dialog for the current selection. If no text is selected, evaluate the current line.

 

You can select the result and copy it to the clipboard.

               

Options:

 

/CIf the specified batch file doesn't exist, create it without prompting.