Running, Pausing, and Stopping
The NewBASIC
Builder primary window contains a row of buttons used to run, pause, step, and stop a program. Depending on your context, one or more of these buttons is likely to be disabled. For instance, the Stop button is greyed out if your program isn't running. This section explains what each button does.
-
The
Run button runs your program. It brings up the program's user interface (UI) components and runs the module_init() routine. Your program is then ready for use. Use this button to test your program and make sure it works. Note that while your program is running, you won't be able to change it: you won't be able to move its UI components around or edit its BASIC code. To make changes, you'll need to stop your program.
-
The
Pause button temporarily halts your program. This allows you to check on the state of your program's variables.
See Examining and Changing Variables
If your program was in the middle of executing a BASIC routine, the Editor window appears and
-
the next line to be executed is highlighted in blue.
-
if there was a
breakpoint set on that line, then it is highlighted in purple.
-
The
Continue button causes your program to resume execution if it has been paused.
-
The
Stop button quits your program. You can then change your program: moving, adding, and removing components and editing its BASIC code.
-
The
Single Step button is only useful if you're paused in a BASIC routine; it executes the next line of code and then pauses again. If the next line of code is a routine call (i.e., a function call or a subroutine call), then it pauses at the beginning of that routine.
-
The
Routine Step button acts like the Single Step button, except in its treatment of routine calls. Where Single Step pauses at the beginning of the called routine ("steps into the routine"), Routine Step executes the called routine and pauses at the next line of the current routine ("steps over the routine").
-
The
Finish button finishes execution of the current routine. If the current routine was called by some other routine, then it finishes and then execution pauses in the routine that called the current routine. Otherwise, this button behaves like the Continue button.