Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Watch Value Command (4 of 4)
Use the Watch Value command to show a variable or watch
expression and its value in the Debug window. When the
value changes the display is updated.
■ To add a watch value, type a variable or expression
in the Expression text box. Then select <Add>.
■ To delete a single watch value, select the
expression from the List box, then select <Remove>.
To delete all watch values, select <Clear All>.
■ To save a debug window, use the Save command in the
File menu. To reload a saved window, put the cursor
in the debug window and use the Merge command.
A watch expression may be any valid Pascal expression.
For example:
count
count + 1
count + 1 = 5
For relational expressions, the Debug window shows FALSE
if the expression is false and TRUE if the expression is
true:
count + 1 = 5 : FALSE
count + 1 = 5 : TRUE
The Debug window shows variables in the default Pascal
format for their type.
Format specifiers control the display of information.
The syntax is an optional repeat counter, optionally
followed by formatting characters:
<expression> [, [ <counter> ] [ <character(s)> ] ]
Decimal D Prints numbers in decimal.
Hexadecimal H Prints numbers in hex preceded by $.
$ and X also specify hexadecimal.
Memory M Displays a memory dump for a memory
address. Specify $, D, H, or X along
with M to format the data.
Pointer P Displays pointers as segment:offset.
Record R Displays field names with values.
Watch formatting examples:
array_variable : (49,48,0,0,0)
array_variable[2],3 : 48,0,0
array_variable[2],3$ : $30,$0,$0
mem[$b800:$40],6H : $20,$70,$20,$70,$52,$70
pointer_variable : PTR($7E81,$5A)
pointer_variable,P : 7E81:005A
pointer_variable,M : 5A 00 81 7E
pointer_variable,MD : 90 0 129 126
record_variable : (12,'Hello')
record_variable,R : (INT_FIELD:12;STR_FIELD:'Hello')
Display memory in a string format by using a typecast:
string(Ptr(prefixSeg,$80)^) : 'command line string'