Liberty BASIC Debugger
Using the Debugger:

Let's take a closer look at how our program works using the debugger (see previous section).  Pull down the Run menu and select Debug.

A Trace Window will appear, and also another window labeled Program named - 'untitled.bas'

Select the Trace Window to bring it to the foreground and to make it the active window.  Notice that it has two panes.  The pane on the top shows variables as they change value.  The pane on the bottom shows each line of code as it executes.  The three buttons on the bottom of the window let you pick three different modes of execution:

    Step  -  Step one line at a time through program execution
    Walk  -  Run the program non stop highlighting each line as it executes
    Run  -  Run full speed.  Do not highlight each line

Execution always begins in Step mode when the Debug option is used.

Now let's click on the Step button once.  Now notice that the Trace Window now highlights the next line, and that a graphics window appears labeled Ellipses.

Click on the trace window to bring it to the front, and click on Step twice more.  The two statements below will be executed:

    print #1, "down"
    print #1, "place 130 130"

You won't be able to immediately see the effect of thesetwo statements.  The first one tells the window's graphic pen to be 'lowered' to the surface of its 'paper'.  The second statement places the pen at 130 in x and y.

Now click on Step again.  Now look at the variables pane in the Trace Window.

This shows that the variable x has been assigned the value 30.  Each and every time that x (or any other variable), changes, we will be informed as to just what that change is.

Now click on Step again.  The line:

    print #1, "ellipse "; x ; " "; 260 - x

will be executed, and you will see this:

Now click on Step a dozen or so times, watching the value of x change and seeing several new ellipses drawn.  Finally, click on Walk and the program will run non-stop, highlighting each line as it goes, and displaying each new value of x.  When this is done, you may close the trace window.  Liberty BASIC will ask if you want to terminate ellipses.bas.  Respond by pressing
Enter or clicking on Yes.  Liberty BASIC will close the other two windows automatically (the graphics window with our ellipses, and the window labeled: Program named: 'untitled.bas').