6-4 HP IBASIC Supplement
Debugging Programs
Examining Variables
Examining Variables
To examine a variable, it is necessary to pause the program. Pause the
program by pressing the softkey ( on an external
keyboard) when a program is running, or by inserting aPAUSE statement
in your program.
A command line becomes active when an IBASIC program is paused or
stopped and an IBASIC display partition is present. (For information on
creating an IBASIC display partition, see “Using IBASIC Display” on
page 5-16.) You may also activate the command line when no IBASIC
window is partitioned by pressing the key on the external
keyboard. A cursor will appear in the lower left portion of the screen
when the command line is active. Strike the key again to
de-activate. Once the command line is active, a variable can be examined
in two ways. Both methods require the use of an external keyboard.
1. Enter the variable name (without a line number) on the command
line. This results in the value assigned to that variable being shown
in the display line of the IBASIC window.
2. Execute the command PRINT Value from the command line (where
Value is the name of the variable being examined). This results in
the value assigned to that variable being shown on the print screen of
the IBASIC window.
To examine a variable without accessing a command line, it is necessary
to add the statement PRINT Value (or DISP Value) to the program
before the PAUSE statement that temporarily stops the program. PAUSE,
PRINT and DISP are all keywords that are included in the IBASIC
editor's label window (see Chapter 5, “Developing Programs,” for a
description of the label window).
NOTE An IBASIC display partition must be active to view the results of a
PRINT statement or to access a command line. The display line (accessed
with the DISP command) is available even when no IBASIC display is
present.
F8
ESC
ESC