Rinput: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
 
Line 30: Line 30:


===Syntax===
===Syntax===
  RINPUT [#<window number>] <string variable>  [<error condition> <line ref>][,...]
  RINPUT [#<window number>] <[[String|string variable]]>  [<[[error condition]]> <[[line ref]]>][,...]
[[Image:Rinput.png]]
[[Image:Rinput.png]]



Latest revision as of 00:02, 6 May 2014

See also: RInput (disambiguation)

The RInput (RI) statement displays the contents of a string variable on the output line at the bottom of the screen or window, allows the operator to change the value from the keyboard, inputs the new value and assigns it to the string variable.

The WAIT= parameter and TIMEOUT error trap may now be used with INPUT/RINPUT statements to force releasing of records. This feature is useful for multi-user situations.

WAIT= specifies the number of seconds the system should wait for operator input before responding with a TIMEOUT error condition. NOTE that WAIT=0 instructs the system to wait for zero seconds, not to ignore the WAIT instruction. Also, -1 is a special WAIT value that instructs the system to wait forever, if necessary. Every time the operator presses any key, the clock is reset for WAIT seconds.

INPUT WAIT=10:X$ TIMEOUT 100
RINPUT WAIT=10:X$ TIMEOUT 100
LINPUT WAIT=10:X$ TIMEOUT 100
INPUT FIELDS "10,10,C 10",WAIT=10:X$ TIMEOUT 100
INPUT #11,FIELDS "10,10,C 10",WAIT=10:X$ TIMEOUT 100
RINPUT FIELDS "10,10,C 10",WAIT=10:X$ TIMEOUT 100
INPUT SELECT "10,10,C 10",WAIT=10:X$ TIMEOUT 100
RINPUT #11,SELECT "10,10,C 10",WAIT=10:X$ TIMEOUT 100

The TIMEOUT error condition traps time-out errors (error code 4145) and specifies the line number of an appropriate error-handling routine.

00100 RELEASE #ITEM:
00110 PRINT "OVER TIME LIMIT"
00120 PRINT "Your hold on inventory items has expired, re-enter order."

Before releasing the record, you may want to go to a routine that warns with a message and a few beeps that the hold on records is about to be released, then gives the operator an opportunity to continue data entry. See the "KSTAT$" function in the manual for information on how to use the WAIT parameter with that function.

Comments and Examples

RINPUT combines the functions of PRINT and LINPUT to allow the operator to update a string variable.

An advantage of RINPUT is that the output and input both occur on the bottom line of the screen where the operator can use cursor keys to merely update parts of the line which need to be changed. If no change is needed, the operator may simply press Enter and the current variable is retained.

Syntax

RINPUT [#<window number>] <string variable>  [<error condition> <line ref>][,...]

Default

1.) Interrupt the program if an error occurs and ON error is not active.

Parameters

The "wind-num" parameter indicates that information is to be input to and output from the bottom line of a window rather than the full screen. The specified window must have already been opened by an OPEN statement.

The required "string variable" parameter represents an unsubscripted or subscripted string variable. After execution of RINPUT, this variable contains the new value.

NOTE that MAT and a matrix (array) name are not allowed in the RINPUT statement.

RINPUT allows error processing with the optional "error-cond line-ref" parameter. See Error Conditions for more information.

Technical Considerations

1.) Relevant error conditions are: ERROR, EXIT
2.) The RINPUT statement has the same keyboard characteristics as LINPUT.
3.) Keyboard buffering operates identically for RINPUT as it does for INPUT and LINPUT.

See Also