

Description:
The SET(DEBUG) built-in is used to perform step by step run-throughs of
procedures and programs and to pass new values to existing variables in currently
defined procedures and programs. There are several variations of this important
built-in, each of which are listed below along with their function and purpose.
Note that when DEBUG is ON, nu/TPU performs a step by step run of any
user-defined procedures when they are called or executed.
Depending on what's being attempted, SET(DEBUG) takes two or three parameters.
The first parameter is always the keyword DEBUG. The second parameter can be
any of the keywords ON, OFF, or PROGRAM, or a variable. The third parameter,
when required, can be the keyword ALL, a currently defined procedure name, the
names of any currently defined buffer, range, program, or string variables, or a
new value when the second parameter is an existing variable's name.
Parameter 2 Parameter 3 Return
ON | OFF Turns nu/TPU debugger ON/OFF, thus enabling single stepping.
OFF ALL Turns OFF all breakpoints during a debugging session.
ON | OFF Procedure Sets or unsets a breakpoint at the entrance to the named procedure.
Procedure Same as previous, except the name debugger is toggled from one state to the
next as it pertains to the named procedure. The difference between this form and
the previous is that the previous allows you to specify which state you want
the debugger in. This form only toggles from what is to what will be.
PROGRAM Buffer This form tells nu/TPU to use the debugging routine contained in the named
buffer.
Range This form tells nu/TPU to use the debugging routine contained in the named
range.
Program This form tells nu/TPU to use the debugging routine contained in the named
program.
String This form tells nu/TPU to use the debugging statements (not routines)
contained in the named string.
Variable New value Places the value passed as the third parameter to the variable as the second.
Syntax:
SET(DEBUG, PROGRAM, {buffer | program | range | string} )
SET(DEBUG, {ON|OFF})
SET(DEBUG, {ON|OFF}, string)
SET(DEBUG, OFF, ALL)
SET(DEBUG, string, value)
Example:
The following sets the DEBUG routine to a PROGRAM named raid. Next it sets a
breakpoint at the entrance to the routine kitchen. Lastly, it sets the value
die to the variable ROACHES.
SET(DEBUG, PROGRAM, raid);
SET(DEBUG, ON, kitchen);
SET(DEBUG, die, ROACHES);
SET(DEBUG)