When the BASIC/FlashBASIC debugger is entered, it indicates the source code line number is to be executed next and prompts for commands with an asterisk. There are several ways to enter the debugger:
Pressing BREAK while a BASIC or FlashBASIC program is executing.
Running the program with a d option:
run bp enter.customer (d) |
If the program is cataloged, a d option may follow the program name at TCL:
enter.customer (d) |
Placing a debug statement within the program at the point where the debugger is needed.
Running the program with an e option, which breaks at any nonfatal warning message:
run bp enter.customer (e) |
If the program is cataloged, an e option may follow the program name at TCL:
enter.customer (e) |
When a run-time error is encountered (unless the a (abort) option of the run command is selected)
When an abort statement is executed in the program.
The * is the BASIC/FlashBASIC debugger prompt character. When it displays in the leftmost column of the terminal display screen, it indicates that the debugger is ready to accept any legal command. The number of * characters indicates the current level.
Breakpoints can be set in the debugger. A breakpoint is a conditional expression constructed with a symbol reference (one of the variables from the program), an operator such as the equal sign or the pound sign, and a specific value. For example, item-ID#"" sets up a conditional break into the debugger when the item-ID variable is non-null.
Breakpoints set up for a subroutine are independent from breakpoints set up in the main program or other subroutines; however, the execution counters e and n are global. That is, the breakpoint counters count both main program and subroutine breakpoints in the order they are encountered. The use of multiple symbol tables allows the programmer to set up different breakpoints and variable traces for different subroutines.
Operators are used to perform relational comparisons and are used with the b command for setting breakpoint conditions. The valid operators are:
= |
Equal to. |
> |
Greater than. |
< |
Less than. |
>= |
Greater than or equal to. |
<= |
Less than or equal to. |
# |
Not equal to. |