The Editor allows you to edit BASIC code. The gadgetry in the upper part of the window allows you to select a routine to edit, create a new routine, or set a breakpoint in a routine. The white area in the lower part of the window is a text editing window where you may edit a routine's BASIC code.
If you wish to edit the contents of one of a component's event handler, choose
The appropriate event handler routine will appear in the text editing area. For instance, suppose your program has a button with the name "button1." If you choose button1 from the Editor window's Components list, then choose clicked from the Events list, the button1_pressed() subroutine should appear. Assuming you haven't entered any BASIC code for that handler yet, it will look like
SUB button1_pressed( self AS integer )
END SUB
To edit an existing routine that is not an event handler, select its name in the Editor window's Routines list. You can also select previously edited event handlers from this list.
As discussed in See Organization of BASIC Code , there are two types of routines: functions, which return values; and subroutines, which do not.
To delete a routine, select its name in the Routines list and press the Delete Routine button.
Breakpoints are used when debugging; we will not discuss them in depth here. For information about using breakpoints, see See Breakpoints: Pausing in Routines .
Pressing the Toggle Breakpoint button causes the selected line (if any) in the Editor window's text edit area to set a breakpoint on that line, or to un-set an existing breakpoint on that line.
If a line of BASIC code has a breakpoint set upon it, it will appear with a red background (dithered black and white in black-and-white mode) in the Editor window text area.
Once you've selected (or created) a routine, its BASIC code appears in the Editor window's text edit area.
When you view routines, some lines of BASIC code may be drawn with a colored background.
If you are running your program from the Builder, you won't be able to edit any routines until you stop it by pressing the Stop button. However, you can still look at routines and set breakpoints.
When you edit routines, only the text between the first and last lines of the routine will be preserved; other text will be lost.
SUB button1_pressed( self AS component )
REM User has clicked the "Go!" button.
REM Reset the score value.
number1.value = 0
END SUB
REM This comment will be lost; it's not inside a routine.