Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SUB ValidateOption (Choice$, Min, Max, Flag)
- REM This subroutine will ensure that the OPTION selcted was valid. IF it IS valid
- REM Flag = 0, IF NOT Flag = 1
- PRINT
- SELECT CASE INT(VAL(Choice$))
- CASE IS > Max
- Flag = 1
- PRINT "Sorry, but the value you have entered is far too big"
- PRINT "Please choose again between"; Min; "and"; Max
- CASE IS < Min
- Flag = 1
- PRINT "Sorry, but the value you have entered is far too small"
- PRINT "Please choose again between"; Min; "and"; Max
- CASE IS > Min AND < Max
- Flag = 0
- CASE ELSE
- Flag = 1
- PRINT "Please choose a number between"; Min; "and"; Max
- END SELECT
- END SUB
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement