SysConsole/SysWindow: Using the Command History

Description

The BBj SysConsole and TermConsole store each command entered at the command prompt ('>') in a sequential history list. When operating in immediate mode with the BBj interpreter waiting for command input, previous commands can be accessed, edited and re-executed with the cursor arrow keys or the F1 through F4 function keys.

Pressing the up arrow or F3 will cycle through the list from the most recently input (the newest) commands to the oldest input commands. Pressing down arrow or F4 moves through the command history in the opposite direction, from the oldest to the newest commands. Pressing ENTER when the desired command is displayed at the prompt will cause that command to be executed once again, saving the effort of typing it out a second time.

Pressing the left or right arrow or the F1 or F2 function keys will put the currently selected command into the editor (the character window editor in a TermConsole, or the character window editor or dialog box editor in a SysConsole, depending upon the setting of the 'Use edit dialog' toggle on the Edit menu). Pressing ENTER after changes have been made in the editor causes the command to be executed.

By default, the command history holds up to 30 commands. Each successive command beyond that number will cause the oldest command to be dropped from the list. The maximum capacity of the command history can be increased or decreased with the `HISTSIZE' mnemonic.

The statement:

 print 'HISTSIZE'(15)

changes the capacity of the command history list to 15 commands. This mnemonic has no effect on a running program and does nothing for a SysWindow, since the command prompt never appears there.

The command history feature prevents the key maps assigned to the cursor arrow keys and F1 through F4 function keys from being accessed from the command prompt. The key maps will work normally during execution of a BBj program or when within an input, read record, InputE or InputN field.