IDE / Batch Debugger

Take Command has a very powerful IDE (Integrated Development Environment) for creating, editing, and debugging batch files. The IDE includes syntax coloring for batch files (.BAT, .BTM, and .CMD) and code folding for command groups, DO, IFF, SWITCH, and TEXT.

 

ide17

 

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

 

If a file in a tab window has been modified but not yet saved, the tab title will be prefixed with a *. When the file is saved, the * is removed.

 

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.

 

 

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 IDE includes tabbed windows to display and/or modify the watch list, 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
ApplyReplace 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.

 

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.

 

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.)

 

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

       

Alt-F11

Alt-Shift-F11

Invoke the Evaluate Expression dialog.

Invoke the Evaluate Expression dialog for the current selection.

 

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