INPUTERR Statement

The INPUTERR statement prints the specified text at the last line of the screen. It is meant to be used in conjunction with the INPUT@ statement.

Format

INPUTERR print-expr

Parameter(s)

print-expr

A print expression, optionally combined with commas for tabulation as in the PRINT statement. See PRINT Statement for more information on the format for print expressions.

Description

An entry to the next INPUT@ statement executed erases any messages previously sent to the bottom of the screen with INPUTERR.

The INPUTERR statement allows the programmer to provide additional error messages to a masked INPUT@ statement. Like the error messages built into the masked INPUT@ statement, the message printed by INPUT@ is cleared from the screen when a response to INPUT@ is received.

Example

To print the message ERROR! NUMERIC DATA EXPECTED on the bottom of the screen, the code would read:

INPUTERR “ERROR! NUMERIC DATA EXPECTED”

The next program asks for the closing date for a property transaction. The closing must occur within 45 days of approving the mortgage, so after the masked INPUT@ statement verifies that a date is entered, it is verified that the date is within 45 days from today. The INPUTERR statement is used if it is not. The program continues to prompt the user for a closing date until a satisfactory one is entered.

EQUATE TRUE TO 1, FALSE TO 0

PROMPT " "

PRINT @(0,0) : "ENTER THE CLOSING DATE : " :

LOOP

   INPUT @(24,0) CLOS.DATE "D"

   TODAY = DATE( )

   IF CLOS.DATE >= TODAY AND CLOS.DATE <

       =TODAY +

   45 THEN

      VALID = TRUE

   END ELSE

      INPUTERR "CLOSING MUST BE COMPLETED

          WITHIN

      45 DAYS"

      VALID = FALSE

   END

UNTIL VALID DO REPEAT

See Also

Statement and Function Reference