The Command Window<Alt-5> Using the command window. ──────────────────────────────────────────────────────────────────────────────
This window allows you to throw commands at MrDebug, either expected or unexpected commands. You may use this window to type expressions, commands, set watch point, break points etc and loads more.
The command line acts similar to some operating system command lines. You may type commands, expressions or just gobbledygook into this window.
Anything that you type will be held in a buffer, so that you can scroll up and down the buffer sing a list of the last commands or expressions entered.
Please note: The default for the insert toggle is on, NOT off!
All output results will be held within a display scroll back buffer so that you can see the commands and results of these commands. This buffer is limited to the size of a full screen and can be seen by expanding the size of the command window.
┌─ 5Command/Expression ─────────────────────────────────┐ ┌─────│len(asettings)↑ │ ┌─│-->80█ │ │ │. ↓ │ │ └────────────────────────────────────────────────────────┛ │ │ │ └──── This line is an example of a command typed in └──────── This line is the resulting output
Only one copy of a command is stored in this buffer so, if you entered the command '?? Fred' twice, only one occurrence of this would be kept in the buffer. Only the last 50 commands are kept.
You may use the ↑ or ↓ cursor keys to flick through the list of commands already in the history list. You may edit any of these commands and they will be added to the history list as the most recent entry if they differ from previous entries ie: you've edited them.
You may even type the first few letters of a command or expression that is in the history buffer and press the ↑ cursor. MrDebug will search through it's history for all occurrences of command entered that begin with the letters that you typed. You may repeatedly press the ↑ cursor if the first or multiple occurrence is not the item that you were looking for. You may also make use of the ↓ cursor key to go back to an item you may have gone past.
To edit an entry on the command line you may use any of the following keys:
<Ctrl><End> - clears all text from the current cursor position to the end of the line <Ctrl><Home> - clears all text from the current command line entry, from the current cursor position to the start of the line <Ctrl><Left> - moves the cursor to the beginning of the previous word <Ctrl><Right> - moves the cursor to the beginning of the next word
The <F3> key will bring up that last entered command.
You are not limited to simple commands in this window, you can even enter expressions - without the usage of the ? operator. A picture is worth a thousand words. Well we couldn't afford an artist so here's a few examples of valid expressions that you can use inside the command window instead:
The ?? command is the same as the Inspect command. It will bring up a variable box with the contents of the variable - any data type.
You can also set watch or trace points from the command window by typing the expression or variable that you wish to set as a trace point or watch point and then by pressing <Alt><W> for a watch point or, <Alt><T> for a trace point. For example, you could type any of the following:
DBFNAME->Fieldname nVar == 10
and press either <Alt><W> or <Alt><T> to mark these as watch point or trace points, respectively.
You can even watch or trace expressions that have been copied from the Source code window by selecting th text in the source code window and by pressing <Shift><Alt><C>.
The following are a list of commands available within the command window:
BP - allows you to set a break point on a specific line, function or even line in a specific module. For examples
BP DrawScreen
will set a function break on the function called DrawScreen.
BP 27
will set a break point on line 27 of the current file.
BP Office 47
will set a break point on line 47 in the file called Office
CLEAR TYPEBEHIND - this option will clear down the history list. It will remove all entries from the history list.
DELETE - deletes something. It may be used with any of the following options :
Watchpoints or WP - deletes all watchpoints Tracepoints or TP - deletes all tracepoints Breakpoints or BP - deletes all breakpoints Passpoints or PP - deletes all passpoints Disabled or ALTD - deletes all disabled ALTD()'s ALL - deletes all wp, tp, bp, pp and disabled ALTD()'s
DISABLE - allows you to disable BPs, TPs etc, so that when the program runs, it will ignore the options that have been disabled. It may be used with the following options:
BP - will ignore all break points PP - will ignore all pass points TP - will ignore all trace points ALTD - does not stop the program on an ALTD() function ALL - will ignore all trace points, all pass points, all break points, and any ALTD() functions in your code.
DOS or SHELL - executes a DOS session. This command accepts parameters so you may pass down parameters to the DOS session to be executed. If you do not have enough free memory then a DOS Shell may not be executed.
ENABLE - allows you to enable, or turn on, options that have been disabled. It may use the following parameters:
BP - will cause MrDebug to stop on break points PP - will use pass points TP - will check for trace points being triggered ALTD - will allow the program to halt on ALTD() functions ALL - will allow mr Debug to check trace points, all pass points, all break points, and any ALTD() functions in your code.
FIND or SEARCH - allows you to search for a piece of text within the current text file open within the source code window. Quotes or " are not need around the string that you are searching for. If a search is successful the file within the source code window will move to the line containing the text that you searched for.
GO or RUN - runs the program.
GO FAST or RUN FAST or FAST - runs the program in FAST RUN Mode.
GOTO - will move you to a line number, as specified by you, within the file held in the source code window.
INSPECT or ?? - This command when used with a variable name allows you to view the contents of a variable.
LIST - Allows you to list BP's, TP's, WP's, PP's and disabled ALTD()'s. use one of the following:
BP - to list all break points TP - to list all trace points PP - to list all pass points WP - to list all watch points ALTD - to list all disabled ALTD's ENABLED - informs you of what options are enabled/disabled.
NEXT or AGAIN - will perform a search based on the previous search command from the current cursor position
QUIT or EXIT - This command will quit MrDebug and return you to the operating system prompt.
RESUME or . - will reposition the information held within MrDebug's windows to the correct point in the program that the program is currently on.
SPEED or DELAY - allows you to change the speed setting for Animation mode. This option only affects the animation setting. Settings are in hundredths of seconds.
STEP - singles steps the program.
TP - allows you to set a trace point on an expression. For example:
TP nCounter
would set a trace point on a variable called nCounter
TP nCounter == 47
would set a trace point on the expression nCounter == 47
VIEW filename - this option allows you to view source code or ascii text files. You need not supply an extension to the filename as .PRG will be assumed. If you wish to view something else then you may need to add an extension to the filename. You may also give the file a drive letter and a path.
You may obtain the filename easily by typing the first letter or few letters of the filename followed by <Shift><F9>, which will find any files that partially match the filename. If there is more than one match to the partial filename, pressing <Shift><F9> will cycle you through the list of matches. The <Shift><F8> key will reverse through the list.
If you supply no extension, the search criteria will assume *.prg, if no partial matches are found then the search will automatically be repeated using a wildcard extension.
WP - allows you to set a watch point on an expression. For example:
WP cString
would set a watch point on a variable called nCounter
WP cString == "Add New"
would set a trace point on the expression cString == "Add New"
This window is also used to display any information from MrDebug to you. Such information could include reasons why a program has stopped running, ie an ALTD() in your code stopped the program, a trace point became active, a break point was reached or the program finished.
The following is an example of the pop-up menu for the Command window, which may be summoned either by clicking the right mouse button on the window or by using <Alt-F10>.