[OpenVMS documentation]
[Site home] [Send comments] [Help with this site] [How to order documentation] [OpenVMS site] [Compaq site]
Updated: 11 December 1998

OpenVMS Debugger Manual


Previous Contents Index


WHILE

Executes a sequence of commands while the language expression (Boolean expression) you have specified evaluates as true.

Format

WHILE Boolean-expression DO (command[;...])


Parameters

Boolean-expression

Specifies a language expression that evaluates as a Boolean value (true or false) in the currently set language.

command

Specifies a debugger command. If you specify more than one command, separate the commands with semicolons (;). At each execution, the debugger checks the syntax of any expressions in the commands and then evaluates them.

Description

The WHILE command evaluates a Boolean expression in the current language. If the value is true, the command list in the DO clause is executed. The command then repeats the sequence, reevaluating the Boolean expression and executing the command list until the expression is evaluated as false.

If the Boolean expression is false, the WHILE command terminates.

Related commands:


Example


DBG> WHILE (X .EQ. 0) DO (STEP/SILENT)
      

This command directs the debugger to keep stepping through the program until X no longer equals 0 (Fortran example).


Appendix A
Predefined Key Functions

When you start the debugger, certain predefined functions (commands, sequences of commands, and command terminators) are assigned to keys on the numeric keypad, to the right of the main keyboard. By using these keys you can enter certain commands with fewer keystrokes than if you were to type them at the keyboard. For example, pressing the COMMA key (,) on the keypad is equivalent to typing GO and then pressing the Return key. Terminals and workstations that have an LK201 keyboard have additional programmable keys compared to those on VT100 keyboards (for example, "Help" or "Remove"), and some of these keys are also assigned debugger functions.

To use function keys, keypad mode must be enabled (SET MODE KEYPAD). Keypad mode is enabled when you start the debugger. If you do not want keypad mode enabled, perhaps because the program being debugged uses the keypad for itself, you can disable keypad mode by entering the SET MODE NOKEYPAD command.

The keypad key functions that are predefined when you start the debugger are identified in summary form in Figure A-1. Table A-1, Table A-2, Table A-3, and Table A-4 identify all key definitions in detail. Most keys are used for manipulating screen displays in screen mode. To use screen mode commands, you must first enable screen mode by pressing the PF3 key (SET MODE SCREEN). In screen mode, to re-create the default layout of various windows, press the keypad key sequence BLUE-MINUS (PF4 followed by the MINUS key (--)).

To use the keypad keys to enter numbers rather than debugger commands, enter the command SET MODE NOKEYPAD.

Figure A-1 Keypad Key Functions Predefined by the Debugger---Command Interface


A.1 DEFAULT, GOLD, BLUE Functions

A given key typically has three predefined functions:

In Figure A-1, the DEFAULT, GOLD, and BLUE functions are listed within each key's outline, from top to bottom respectively. For example, pressing keypad key KP0 enters the command STEP (DEFAULT function); pressing PF1 and then KP0 enters the command STEP/INTO (GOLD function); pressing PF4 and then KP0 enters the command STEP/OVER (BLUE function).

All command sequences assigned to keypad keys are terminated (executed immediately) except for the BLUE functions of keys KP2, KP4, KP6, and KP8. These unterminated commands are symbolized with a trailing ellipsis (...) in Figure A-1. To terminate the command, supply a parameter and then press Return. For example, to scroll down 12 lines:

  1. Press the PF4 key.
  2. Press keypad key KP2.
  3. Type :12 at the keyboard.
  4. Press the Return key.

A.2 Key Definitions Specific to LK201 Keyboards

Table A-1 lists keys that are specific to LK201 keyboards and do not appear on VT100 keyboards. For each key, the table identifies the equivalent command and, for some keys, an equivalent keypad key that you can use if you do not have an LK201 keyboard.

Table A-1 Key Definitions Specific to LK201 Keyboards
LK201 Key Command Sequence Invoked Equivalent
Keypad Key
F17 SET KEY/STATE=DEFAULT None
F18 SET KEY/STATE=MOVE None
F19 SET KEY/STATE=EXPAND None
F20 SET KEY/STATE=CONTRACT None
Help HELP KEYPAD SUMMARY None
Next Screen SCROLL/DOWN KP2
Prev Screen SCROLL/UP KP8
Remove DISPLAY/REMOVE %CURSCROLL None
Select SELECT/SCROLL %NEXTSCROLL KP3

A.3 Keys That Scroll, Move, Expand, Contract Displays

By default, keypad keys KP2, KP4, KP6, and KP8 scroll the current scrolling display. Each key controls a direction (down, left, right, and up, respectively). By pressing F18, F19, or F20, you can place the keypad in the MOVE, EXPAND, or CONTRACT states. When the keypad is in the MOVE state, you can use KP2, KP4, KP6, and KP8 to move the current scrolling display down, left, and so on. Similarly, in the EXPAND and CONTRACT states, you can use the four keys to expand or contract the current scrolling display. (See Figure A-1 and Table A-2. Alternative key definitions for VT100 keyboards are described later in this section.)

To scroll, move, expand, or contract a display:

  1. Press KP3 repeatedly, as needed, to select the current scrolling display from the display list.
  2. Press F17, F18, F19, or F20 to put the keypad in the DEFAULT (scroll), MOVE, EXPAND, or CONTRACT state, respectively.
  3. Press KP2, KP4, KP6, and KP8 to do the desired function. Use the PF1 (GOLD) and PF4 (BLUE) keys to control the amount of scrolling or movement.

Table A-2 Keys That Change the Key State
Key Description
PF1 Invokes the GOLD function of the next key you press.
PF4 Invokes the BLUE function of the next key you press.
F17 Puts the keypad in the DEFAULT state, enabling the scroll-display functions of KP2, KP4, KP6, and KP8. The keypad is in the DEFAULT state when you invoke the debugger.
F18 Puts the keypad in the MOVE state, enabling the move-display functions of KP2, KP4, KP6, and KP8.
F19 Puts the keypad in the EXPAND state, enabling the expand-display functions of KP2, KP4, KP6, and KP8.
F20 Puts the keypad in the CONTRACT state, enabling the contract-display functions of KP2, KP4, KP6, and KP8.

If you have a VT100 keyboard, you can simulate the effect of LK201 keys F17 to F20 by assigning the functions of those keys to other key sequences. You can make key assignments in a command procedure, such as your debugger initialization file (see init_sec). The following code contains key assignments that allow key sequences GOLD-KP9 and BLUE-KP9 (currently undefined) to mimic the effects of cycling through keys F17 to F20). When these key assignments are in effect, Press GOLD-KP9 to put the keypad in the DEFAULT (scroll) state; press BLUE-KP9 repeatedly to cycle the keypad through the DEFAULT, MOVE, EXPAND, and CONTRACT states.


DEFINE/KEY/IF_STATE=(GOLD,MOVE_GOLD,EXPAND_GOLD,CONTRACT_GOLD)- 
 /TERMINATE KP9 "SET KEY/STATE=DEFAULT/NOLOG" 
DEFINE/KEY/IF_STATE=(BLUE)- 
 /TERMINATE KP9 "SET KEY/STATE=MOVE/NOLOG" 
DEFINE/KEY/IF_STATE=(MOVE_BLUE)- 
 /TERMINATE KP9 "SET KEY/STATE=EXPAND/NOLOG" 
DEFINE/KEY/IF_STATE=(EXPAND_BLUE)- 
 /TERMINATE KP9 "SET KEY/STATE=CONTRACT/NOLOG" 
DEFINE/KEY/IF_STATE=(CONTRACT_BLUE)- 
 /TERMINATE KP9 "SET KEY/STATE=DEFAULT/NOLOG" 

A.4 Online Keypad Key Diagrams

Online help for the keypad keys is available by pressing the Help key and also the PF2 key, either by itself or with other keys (see Table A-3). You can also use the SHOW KEY command to identify key definitions.

Table A-3 Keys That Invoke Online Help to Display Keypad Diagrams
Key or
Key Sequence
Command Sequence Invoked Description
Help HELP KEYPAD SUMMARY Shows a diagram of the keypad keys and summarizes each key's function
PF2 HELP KEYPAD DEFAULT Shows a diagram of the keypad keys and their DEFAULT functions
PF1-PF2 HELP KEYPAD GOLD Shows a diagram of the keypad keys and their GOLD functions
PF4-PF2 HELP KEYPAD BLUE Shows a diagram of the keypad keys and their BLUE functions
F18-PF2 HELP KEYPAD MOVE Shows a diagram of the keypad keys and their MOVE DEFAULT functions
F18-PF1-PF2 HELP KEYPAD MOVE_GOLD Shows a diagram of the keypad keys and their MOVE GOLD functions
F18-PF4-PF2 HELP KEYPAD MOVE_BLUE Shows a diagram of the keypad keys and their MOVE BLUE functions
F19-PF2 HELP KEYPAD EXPAND Shows a diagram of the keypad keys and their EXPAND DEFAULT functions
F19-PF1-PF2 HELP KEYPAD EXPAND_GOLD Shows a diagram of the keypad keys and their EXPAND GOLD functions
F19-PF4-PF2 HELP KEYPAD EXPAND_BLUE Shows a diagram of the keypad keys and their EXPAND BLUE functions
F20-PF2 HELP KEYPAD CONTRACT Shows a diagram of the keypad keys and their CONTRACT DEFAULT functions
F20-PF1-PF2 HELP KEYPAD CONTRACT_GOLD Shows a diagram of the keypad keys and their CONTRACT GOLD functions
F20-PF4-PF2 HELP KEYPAD CONTRACT_BLUE Shows a diagram of the keypad keys and their CONTRACT BLUE functions

A.5 Debugger Key Definitions

Table A-4 identifies all key definitions.

Table A-4 Debugger Key Definitions
Key State Command Invoked or Function
KP0 DEFAULT STEP
  GOLD STEP/INTO
  BLUE STEP/OVER
KP1 DEFAULT EXAMINE. Examines the logical successor of the current entity, if one is defined (the next location).
  GOLD EXAMINE ^. Enables you to examine the logical predecessor of the current entity, if one is defined (the previous location).
  BLUE Displays three sets of predefined process-specific source and instruction displays, SRC_ n and INST_ n. These consist of source and instruction displays for the visible process at S2 and RS2, respectively; source and instruction displays for the previous process on the process list at S1 and RS1, respectively; and source and instruction displays for the next process on the process list at S3 and RS3, respectively.
KP2 DEFAULT SCROLL/DOWN
  GOLD SCROLL/BOTTOM
  BLUE SCROLL/DOWN (not terminated). To terminate the command, supply the number of lines to be scrolled (: n) or a display name.
  MOVE MOVE/DOWN
  MOVE_GOLD MOVE/DOWN:999
  MOVE_BLUE MOVE/DOWN:5
  EXPAND EXPAND/DOWN
  EXPAND_GOLD EXPAND/DOWN:999
  EXPAND_BLUE EXPAND/DOWN:5
  CONTRACT EXPAND/DOWN:-1
  CONTRACT_GOLD EXPAND/DOWN:-999
  CONTRACT_BLUE EXPAND/DOWN:-5
KP3 DEFAULT SELECT/SCROLL %NEXTSCROLL. Selects as the current scrolling display the next display in the display list after the current scrolling display.
  GOLD SELECT/OUTPUT %NEXTOUTPUT. Selects the next output display in the display list as the current output display.
  BLUE Displays three predefined process-specific source displays, SRC_ n. These are located at S1, S2, and S3, respectively, for the previous, current (visible), and next process on the process list.
KP4 DEFAULT SCROLL/LEFT
  GOLD SCROLL/LEFT:255
  BLUE SCROLL/LEFT (not terminated). To terminate the command, supply the number of lines to be scrolled (: n) or a display name.
  MOVE MOVE/LEFT
  MOVE_GOLD MOVE/LEFT:999
  MOVE_BLUE MOVE/LEFT:10
  EXPAND EXPAND/LEFT
  EXPAND_GOLD EXPAND/LEFT:999
  EXPAND_BLUE EXPAND/LEFT:10
  CONTRACT EXPAND/LEFT:-1
  CONTRACT_GOLD EXPAND/LEFT:-999
  CONTRACT_BLUE EXPAND/LEFT:-10
KP5 DEFAULT EXAMINE/SOURCE .%SOURCE_SCOPE\%PC; EXAMINE/INST .%INST_SCOPE\%PC. In line (noscreen) mode, displays the source line and the instruction to be executed next. In screen mode, centers the current source display on the next source line to be executed, and the current instruction display on the next instruction to be executed.
  GOLD SHOW CALLS
  BLUE SHOW CALLS 3
KP6 DEFAULT SCROLL/RIGHT
  GOLD SCROLL/RIGHT:255
  BLUE SCROLL/RIGHT (not terminated). To terminate the command, supply the number of lines to be scrolled (: n) or a display name.
  MOVE MOVE/RIGHT
  MOVE_GOLD MOVE/RIGHT:999
  MOVE_BLUE MOVE/RIGHT:10
  EXPAND EXPAND/RIGHT
  EXPAND_GOLD EXPAND/RIGHT:999
  EXPAND_BLUE EXPAND/RIGHT:10
  CONTRACT EXPAND/RIGHT:-1
  CONTRACT_GOLD EXPAND/RIGHT:-999
  CONTRACT_BLUE EXPAND/RIGHT:-10
KP7 DEFAULT DISPLAY SRC AT LH1, INST AT RH1, OUT AT S45, PROMPT AT S6; SELECT/SCROLL/SOURCE SRC; SELECT/INST INST; SELECT/OUT OUT. Displays the SRC, INST, OUT, and PROMPT displays with the proper attributes.
  GOLD DISPLAY INST AT LH1, REG AT RH1, OUT AT S45, PROMPT AT S6; SELECT/SCROLL/INST INST; SELECT/OUT OUT. Displays the INST, REG, OUT, and PROMPT displays with the proper attributes.
  BLUE Displays two sets of predefined process-specific source and instruction displays, SRC_ n and INST_ n. These consist of source and instruction displays for the visible process at Q1 and RQ1, respectively, and source and instruction displays for the next process on the process list at Q2 and RQ2, respectively.
KP8 DEFAULT SCROLL/UP
  GOLD SCROLL/TOP
  BLUE SCROLL/UP (not terminated). To terminate the command, supply the number of lines to be scrolled (: n) or a display name.
  MOVE MOVE/UP
  MOVE_GOLD MOVE/UP:999
  MOVE_BLUE MOVE/UP:5
  EXPAND EXPAND/UP
  EXPAND_GOLD EXPAND/UP:999
  EXPAND_BLUE EXPAND/UP:5
  CONTRACT EXPAND/UP:-1
  CONTRACT_GOLD EXPAND/UP:-999
  CONTRACT_BLUE EXPAND/UP:-5
KP9 DEFAULT DISPLAY %NEXTDISP. Displays the next display in the display list through its current window (removed displays are not included).
  GOLD SET PROCESS/VISIBLE %NEXT_PROCESS. Makes the next process in the process list the visible process.
  BLUE Displays two predefined process-specific source displays, SRC_ n. These are located at Q1 and Q2, respectively, for the visible process and for the next process on the process list.
PF1   Invokes the GOLD function of the next key you press.
PF2   Shows a diagram of the keypad keys and their DEFAULT functions
PF3 DEFAULT SET MODE SCREEN; SET STEP NOSOURCE. Enables screen mode and suppresses the output of source lines that would normally appear in the output display (since that output is redundant when the source display is present).
  GOLD SET MODE NOSCREEN; SET STEP SOURCE. Disables screen mode and restores the output of source lines.
  BLUE DISPLAY/GENERATE. Regenerates the contents of all automatically updated displays.
PF4   Invokes the BLUE function of the next key you press.
COMMA DEFAULT GO
  GOLD SELECT/SOURCE %NEXT_SOURCE. Selects the next source display in the display list as the current source display.
  BLUE SELECT/INSTRUCTION %NEXTINST. Selects the next instruction display in the display list as the current instruction display.
MINUS DEFAULT DISPLAY %NEXTDISP AT S12345, PROMPT AT S6; SELECT/SCROLL %CURDISP. Displays the next display in the display list at essentially full screen (top of screen to top of PROMPT display). Selects that display as the current scrolling display.
  GOLD Undefined.
  BLUE DISPLAY SRC AT H1, OUT AT S45, PROMPT AT S6; SELECT/SCROLL/SOURCE SRC; SELECT/OUT OUT. Displays the SRC, OUT, and PROMPT displays with the proper attributes. This is the default display configuration.
Enter   Enables you to enter (terminate) a command. Same effect as Return.
PERIOD All states Cancels the effect of pressing state keys that do not lock the state, such as GOLD and BLUE. Does not affect the operation of state keys that lock the state, such as MOVE, EXPAND, and CONTRACT.
Next Screen (E6) DEFAULT SCROLL/DOWN
Prev Screen (E5) DEFAULT SCROLL/UP
Remove (E3) DEFAULT DISPLAY/REMOVE %CURSCROLL. Removes the current scrolling display from the display list.
Select (E4) DEFAULT SELECT/SCROLL %NEXTSCROLL. Selects as the current scrolling display the next display in the display list after the current scrolling display.
F17   Puts the keypad in the DEFAULT state, enabling the scroll-display functions of KP2, KP4, KP6, and KP8. The keypad is in the DEFAULT state when you invoke the debugger.
F18   Puts the keypad in the MOVE state, enabling the move-display functions of KP2, KP4, KP6, and KP8.
F19   Puts the keypad in the EXPAND state, enabling the expand-display functions of KP2, KP4, KP6, and KP8.
F20   Puts the keypad in the CONTRACT state, enabling the contract-display functions of KP2, KP4, KP6, and KP8.
Ctrl/W   DISPLAY/REFRESH
Ctrl/Z   EXIT


Previous Next Contents Index

[Site home] [Send comments] [Help with this site] [How to order documentation] [OpenVMS site] [Compaq site]
[OpenVMS documentation]

Copyright © Compaq Computer Corporation 1998. All rights reserved.

Legal
4538PRO_064.HTML