INPUTE Verb

Syntax

INPUTE col,row,len,pad$,val${:(verifyoptions)}
INPUTE col,row,mask$,pad$,val${:(verifyoptions)}
INPUTE col,row,len,pad$,initpos,restore$,val${:(verifyoptions)}
INPUTE col,row,mask$,pad$,initpos,restore$,val${:(verifyoptions)}

Description

The INPUTE verb provides user input from the keyboard (similar to INPUT) but with editing and additional verification capabilities.

Parameter

Description

col

Column position of the input region

row

Row position of the input region.

mask$

Input mask. (Provides more verification capabilities than len.)

len

Length of the returned string.

pad$

Input pad character.

val$

Default value.

initpos

Simple numeric variable indicating the beginning of the input region. If this parameter is included, the cursor moves to that input position (where initpos=1 is the beginning of the input region). If this parameter is not included, the cursor is moved to the beginning of the input region.

restore$

Restore string.

verifyoptions

Verification options.

The first two syntax forms are similar, but using mask$ (instead of len) provides more verification capabilities. When a mask is used, the length of the input is determined by the length of the mask. The third and fourth syntax forms take two additional parameters, 1) initpos must be a simple numeric variable, and 2) restore$ can be any string expression.

INPUTE may only be executed on channel 0 and does the following:

  • If SETOPTS byte 1 bit $20$ is set, INPUTE will begin in insert mode. If not set, INPUTE will begin in replace mode. Toggling the EDIT mode with Ctrl+T will also toggle this SETOPTS bit.

  • If pad$ is not empty, the current value of val$ is displayed, beginning at position(col,row) on the screen. If a mask is used, the value is displayed with the mask. Any remaining columns in the input region are displayed with the pad$ character (if pad$ is set to $00$, and mask$ is used, the remaining columns are padded with mask characters). PRO/5 does not allow an input region to go past the end of a line, or, wrap around to the next line on the screen. If pad$ is empty, no pad character is used.

  • If the input starts at the beginning of the input region, a new value may be typed over the old value. When the first keystroke is entered, the old value is blanked, and the new input is now in progress. If the user begins with any editing or cursor movement command, the old value is retained and may be edited. Note that editing is always active, even when entering a new value.

  • During input, if the user performs a "restore" operation, the input region is set to the value of restore$, if given; otherwise, it is set to the initial value of val$.

  • When input is terminated, (usually by pressing Enter) the field is redisplayed with any pad characters removed. The result of the input is returned to val$. If initpos is given, the current input position is also returned.

The supported editing commands are described in PRO/5 Editing in the User's Reference Guide.

The mask$ may provide character type verification as well as cosmetic insert characters. For example, a telephone number could be input with a mask of "(000) 000-0000". PRO/5 displays the value with the parentheses, space, and dash. As the user types, the cursor automatically skips over any position in the mask that is not a "0". The zeros tell PRO/5 to allow only numeric characters in those positions. The following characters represent input positions in a mask:

Mask Character

Accepts

X

Any printable character.

a

Any alphabetic character.

A

Any alphabetic character. Converts lower-case alphabetic characters to upper case.

0

Any digit.

z

Any digit or alphabetic character.

Z

Any digit or alphabetic character. Converts lower-case alphabetic characters to upper case.

Any other character in a mask simply appears on the display. PRO/5 does not require every input position in a mask to be filled. The application program must perform any additional verification checks; however, INPUT verification options are legal. See the String Input Verification section of the User's Reference Guide. For example:

1000 INPUTE (0,ERR=2000) C,R,M$,P$,A$:("end"=3000,LEN=1,5)

The optional initpos and restore$ arguments allow the application to resume input as though the INPUTE verb was never terminated. This allows the developer to "insert" additional program logic such as more verification and help menus. For example, the following program fragment:

1000 REM - assume A$ cont.current value to input
1010 LET SAVE$=A$,CURPOS=1
1020 INPUTE(0,ERR=1020)COL,ROW,LEN,PAD$,CURPOS,SAVE$,A$
1030 .
1040 .do additional verification on line help, etc.
1050 .
1060 IF must_resume_input THEN GOTO 1020

When the loop is taken back to INPUTE, it will appear that user input is continuing where it left off. CURPOS remembers where the user was, and SAVE$ retains the original data if the user quits and does a restore. A$ is the current value of the input.

See Also

READ Verb

Verbs - Alphabetical Listing