stopwhen
set a watchpoint on a specified variable
stopwhenif
set a conditional watchpoint on a specified variable
unstopwhen
clear a watchpoint on a specified variable
Calling Sequence
Parameters
Description
Examples
stopwhen(variable)
stopwhenif(variable, value)
unstopwhen(variable)
variable
-
specification of the variable to watch
value
specification of the value to watch for
The stopwhen function sets a watchpoint on the specified local or global variable, and returns the current list of watchpoints. If no variable is specified, the current list of watchpoints is simply returned.
A global variable is specified simply by its name. A local variable is specified by a two element list, the first element of which is the name of the procedure, and the second element of which is the name of the variable within the procedure.
Watching a global variable can also be restricted to modifications made to it within a specific procedure by using the notation used for watching local variables.
The stopwhenif function sets a watchpoint for a specific value on the specified global variable, and returns the current list of watchpoints.
The unstopwhen function clears the watchpoints on the specified variable and returns the current list of watchpoints. If no variable is specified, all watchpoints are cleared.
When a variable that is being watched is modified during the execution of a procedure, the debugger is invoked, and the value of the variable and the statement following the one responsible for the modification is displayed (after the variable has been modified).
If the watchpoint was set using stopwhenif, execution stops only if the value assigned to the variable matches the value specified in the call to stopwhenif
Note: These examples illustrate the use of these debugger commands in Maple's command-line interface. In the standard (graphical) interface, the debugger runs in its own window, with controls for most of the common commands. See Interactive Maple Debugger for details.
f := proc(x) global a; local b; a := x; b := x; x^2 end proc:
stopwhen⁡a
a
stopwhen⁡f,b
a,f,b
f⁡3
a := 3
f:
2 b := x;
DBG> cont
b := 3
3 x^2
9
unstopwhen⁡f,b
stopwhenif⁡a,4
f⁡2
4
f⁡4
a := 4
16
See Also
debugger
Interactive Maple Debugger
stopat
stoperror
stoplast
Download Help Document