``

prev Menu next

DEBUG

Full BASIC has debugging facilities BREAK and TRACE.
When you use these facilities, you must execute DEBUG ON beforehand.
`DEBUG ON`
activates the debug facilities.
`DEBUG OFF`
inactivates the debug facilities.
The default is OFF.
The scope of a DEBUG statement is the program unit, and the setting remains hereafter statically.
( In this sense, DEBUG has abnormality among the statements of Full BASIC.)
`BREAK`
If BREAK is executed when debug facilities are activated, it interrupts the execution of the program and displays the Debug Window, provided that when BREAK is written on a when-body, it raises an exception of extype 10007.
If debug facilities are not activated, BREAK does nothing.
`TRACE ON`
If TRACE ON is executed when debug facilities are activated, trace facility is activated on the program unit where is executed.
Trace results are output to the same window as PRINT statements use.
Trace reports are the statements executed, the variables varied and the new value of them.
`TRACE ON TO #Channel_Number`
Trace reports are output to the channel.
`TRACE OFF`
Trace facility shall be inactivated on the program unit.
Note.
The scope of a TRACE statement is the program unit. Any program unit is set trace off on the invocation.
Note.
Usage of the debug window is convenient rather than the debug using program codes.
To display the debug window, select RUN-STEP.
Refer to debug Window
Note.
An original statement PAUSE enables the program to transfer to the Debug state.