Track program execution.
Debugging commands are essential to find programming errors. They help with inspecting programs and data, to pause a program, to find out why a program takes too much time, and much more. Logo can pause because of several reasons:
- The PAUSE command has been executed
- A runtime error has been hit
- The PAUSE icon has been clicked, or the F4 key has been pressed
The debugging icons in the Toolbar have the following meaning:
|F3||TOPLEVEL||Halts a program and returns to toplevel.|
|F4||PAUSE||Pauses a program and enters Pause mode.|
Prints a backtrace.
Ends a pause.
CONTINUE ends a pause. A Logo program can pause because is it is stepped
STEP), because a breakpoint has been hit, or the PAUSE
command has been executed, or if Logo has hit a runtime error.
NOTE: The abbreviation
CO is usually an
abbreviation for the ALL command. Only during a pause,
CO is redefined to CONTINUE.
Outputs the number of microseconds spent inside a procedure.
EXECTIME outputs a timer value in microseconds. This timer is local to a procedure and starts once the procedure is invoked. EXECTIME is handy to measure execution times of a procedure.
TO TESTTIMER PR EXECTIME WAIT 1234 PR EXECTIME END
Pauses a procedure.
PAUSE temporarily halts the execution of a procedure. PAUSE makes it possible to check variables or change the environment during the execution of a procedure. Using the PAUSE command is equivalent to setting a breakpoint in the editor window. When Logo pauses, the editor windows are set to read-only, because the procedure environment is “frozen”. Command like TO or DEFINE are also disabled when Logo pauses. To resume execution of the procedure, press the GO button or type CO or CONTINUE. To return to toplevel, press the STOP button or type TOPLEVEL. PAUSE may only be used within a procedure.
TO SQUAREDRAW FORWARD 60 RT 90 PAUSE REPEAT 3 [FD 60 RT 90] END