!EDIT.INPUT subroutine

Syntax

CALL !EDIT.INPUT (keys, wcol, wrow, wwidth, buffer, startpos, 
bwidth, ftable, code)

Qualifiers

Table 1. Qualifiers
  Value Token Description
keys

Controls certain operational characteristics. keys can take the additive values (the token names can be found in the GTI.FNKEYS.IH include file) shown here:

   
  0 IK$NON None of the keys below are required.
  1 IK$OCR Output a carriage return.
  2 IK$ATM Terminate editing as soon as the user has entered bwidth characters.
  4 IK$TCR Toggle cursor-visible state.
  8 IK$DIS Display contents of buffer string on entry.
  16 IK$HDX Set terminal to half-duplex mode (restored on exit).
  32 IK$INS Start editing in insert mode. Default is overlay mode.
  64 IK$BEG Separate Begin Line/End Line functionality required.
wcol

The screen column of the start of the window (x coordinate).

   
wrow

The screen row for the window (y coordinate).

   
wwidth

The number of screen columns the window occupies.

   
buffer

Contains the following:

   
  on entry

The text to display (if key IK$DIS is set).

 
  on exit

The final edited value of the text.

 
startpos

Indicates the cursor position as follows:

   
  on entry

The initial position of the cursor (from start of buffer).

 
  on exit

The position of the cursor upon exit.

 
bwidth

The maximum number of positions allowed in buffer. bwidth can be more than wwidth, in which case the contents of buffer scroll horizontally as required.

   
ftable

A packed function key trap table, defining which keys cause exit from the !EDIT.INPUT function. The !PACK.FNKEYS function creates the packed function key trap table.

   
code

The reply code:

   
  = 0

User pressed Return or entered bwidth characters and IK$ATM was set.

 
  > 0

The function key number that terminated !EDIT.INPUT.

 

Description

Use the !EDIT.INPUT subroutine to request editable terminal input within a single-line window on the terminal. Editing keys are defined in the terminfo files and can be set up using the KEYEDIT, KEYTRAP and KEYEXIT statements. To ease the implementation, the UNIVERSE.INCLUDE file GTI.FNKEYS.IH can be included to automatically define the editing keys from the current terminfo definition. We recommend that you use the INCLUDE file.

All input occurs within a single-line window of the terminal screen, defined by the parameters wrow, wcol, and wwidth. If the underlying buffer length bwidth is greater than wwidth and the user performs a function that moves the cursor out of the window horizontally, the contents of buffer are scrolled so as to keep the cursor always in the window.

If the specified starting cursor position would take the cursor out of the window, the buffer's contents are scrolled immediately so as to keep the cursor visible. !EDIT.INPUT does not let the user enter more than bwidth characters into the buffer, regardless of the value of wwidth.