RosettaCodeData/Task/User-input-Text/OPL/user-input-text.opl

31 lines
685 B
Plaintext

PROC usrinpt:
LOCAL string$(15),number&
WHILE string$=""
PRINT "Please enter a string."
INPUT string$
IF string$=""
PRINT "Nothing was entered. Please try again."
PAUSE 60
CLS
ENDIF
ENDWH
PRINT "Thank you! You entered: ";string$
WHILE number&<>75000
PRINT "Please enter the number 75000."
TRAP INPUT number&
IF ERR=-1
PRINT
PRINT "That's not a valid number. Please try again."
PAUSE 60
CLS
ELSEIF number&<>75000
PRINT "Wrong number. Please try again."
PAUSE 60
CLS
ENDIF
ENDWH
PRINT "Good job! You successfully entered 75000!"
PRINT "Press any key to continue."
GET
ENDP