If a script doesn't work as you expect, and you need more information in order to work out why, Rexx Center features a built-in debugger. The commands for the debugger's operation are under the Debug menu or accessible via the toolbar buttons.

This debugger displays information about what is happening with REXX variables and your script's operation while your script is running. The editor window (of the running script) also highlights each instruction as it executes, in sync with the debugger's information. So, you can see exactly what is going on with each instruction in your script, and hopefully locate the problem quickly.

The debugger has a feature whereby it can execute one instruction, display some information about that instruction's operation, and then pause before proceeding to the next instruction. This gives you time to study the debugger's information after each instruction. When you're ready, you tell the debugger to proceed to the next instruction, display information about that next instruction's operation, and then pause once again. This is referred to as stepping through the instructions.

Alternately, you can mark a particular line in the editor window, and let the debugger run your script without pause, until such time as the script tries to execute that particular line that you marked. When this happens, the debugger will pause the script on that line, and the editor window will highlight it. Marking a line for this purpose is referred to as setting a breakpoint. You can then proceed to step through the instruction on that line (and subsequent lines), and study the information that the debugger displays. (Or perhaps, you'll tell the debugger to resume running the script without pause, until it encounters another breakpoint).

There are a number of other debugger features that will be discussed later. These can aid in trouble-shooting a script that isn't working as expected.

If the script successfully ends itself with an EXIT or RETURN instruction, then the message "Script has finished successfully." will appear in the Status Bar. At that point, the debugger automatically stops. Alternately, you can prematurely abort a script with the "Abort debugger" menu command or toolbar button.