BBj WinConsole Overview
The BBj WinConsole can be used to load, run, edit, save, and debug BBx programs.
Loading a Program in WinConsole
Programs are loaded into the WinConsole editor using the LOAD verb at the WinConsole command prompt.
For more information on the command prompt, see the Command Prompt section. The WinConsole editor can load BBx tokenized files, BBj tokenized files and ASCII programs. When a program is loaded, it is parsed and checked for syntax errors. Lines containing syntax errors will have a yellow rectangle in the margin of the line saying Error. For more information on the margins, see the Editing a Program in WinConsole section.
Running a Program in WinConsole
Once a program is loaded, it is ready to run. A program can run with syntax errors, but if an error line is executed, an !ERROR 20 will be thrown. As in the SysConsole, the command prompt can be used to run the program, either by dot-stepping or by typing the RUN verb into the command prompt. "Dot-stepping" refers to typing "." and then the Enter key into the command prompt. This will execute the current line only. When dot-stepping, the next line to be executed will be indicated by a blue arrow in the margin. The executed line will be scrolled into view when the execution line changes.
Editing a Program in WinConsole
The current program can be edited in the editor while program is not "busy." A program is busy when a command is being executed. When a program is busy, the command prompt will not be editable, and the prompt will display "busy..." When the command prompt is editable, the current program is also editable.
Any changed lines will be parsed and checked for syntax errors when focus leaves the line. The changes will reflect in the current program if the changed line is executed. Lines with user line numbers added at the command prompt will not be displayed in the Editor unless the program is saved and reloaded, or is listed using the LIST verb. The LIST verb will display the listing in the SysWindow.
The Editor can be scrolled to view lines that are not currently displayed.
Saving a Program in WinConsole
Programs are saved from the WinConsole by using the SAVE verb at the command prompt, which saves the file in BBj tokenized format.
For more information, see the SAVE verb.
Debugging a Program in WinConsole
As in the BBj SysConsole, the command prompt is used to run the currently loaded program, either by dot-stepping or by typing the RUN verb into the command prompt. "Dot-stepping" refers to typing "." and then the Enter key, which executes program lines one at a time. The BBj WinConsole adds some features to make simple debugging easier, such as breakpoints and watches.
Breakpoints are used to tell the BBj interpreter to pause execution just before the line containing the breakpoint, much like the ESCAPE verb. Once a program is loaded into the Editor and while the program is not busy, a breakpoint can be set at any line by clicking once on the margin to the left of the text. A red rectangle will appear containing the word Stop. For more information on the margin, see WinConsole Editor.
When a program is run using the RUN verb, execution will stop when it hits a line containing a breakpoint. To remove a breakpoint, click once on the margin of a line containing a breakpoint and it will toggle off. Any number of breakpoints can be put into a program. Breakpoints only stay active while the program is loaded in the WinConsole. When a program is closed or exited, any active breakpoints will be lost.
Variables in the running program can be monitored in the Watch Tab of the WinConsole. "Watched" variables have their values updated as they change during program execution.
To watch a variable in the current program, or a variable that has been entered at the command prompt, type the following at the command prompt:
.WATCH <variable name>
If the variable has been initialized in the active program, the variable name will appear in the watch window along with its current value. If the variable has not been initialized or is not in the active program, then the variable will not appear in the watch window. To remove a watch on a variable type:
.UNWATCH <variable name>
The History Tab displays all the program statements that have been executed in the current debugging session, whether those commands were typed at the command prompt by the user, or executed from the loaded program via dot-stepping from the command prompt. Note that lines executed from the program after using the RUN verb are not displayed.
Runtime errors are also displayed in the History Tab.
Closing the BBj WinConsole
To close the BBj WinConsole, do one of the following:
Enter BYE or RELEASE at the command prompt.
Click on the close box icon in the upper right corner of the BBj WinConsole window.
Warning: If any of the programs in the WinConsole have been changed but not yet saved, the changed contents of the programs will be lost.