! ----- GET_RESTRICTED.FUN ----- ! ! ----- SUBROUTINE TO GET [NON-]RESTRICTED RESPONSE ----- ! ! ---------- PASSED: ---------- ! ! ----- BACKWARDS = TRUE if we're moving backwards thru prompts ! ----- DEBUG_MODE = TRUE if Debug Mode was enabled ! ----- DEFAULT_RESTRICTED = Default [Non-]Restricted response ! ----- DIV = User-entered division for this new user ! ----- PLEASE_TRY_AGAIN = "Please Try Again" error message ! ! ---------- RETURNED: ---------- ! ! ----- ACTION_SEQ = Next User Input Sequence routine ! ----- BACKWARDS = TRUE if we're moving backwards thru prompts ! ----- ENTERED_RESTRICTED = User-entered [Non-]Restricted ! ! ----- Last Change 07/20/93 by Brian Lomasky ----- ! SUB GET_RESTRICTED(STRING ENTERED_RESTRICTED) %INCLUDE "NUSER.INC" DECLARE WORD RECORD_FOUND ! TRUE IF MATCHING RECORD FOUND DECLARE WORD VALID_ENTRY ! TRUE IF VALID ENTRY IF DIV = "PGM" THEN IF BACKWARDS THEN ACTION_SEQ = ACTION_SEQ - 1% EXIT SUB END IF VALID_ENTRY = TRUE ENTERED_RESTRICTED = "N" ELSE VALID_ENTRY = FALSE BACKWARDS = FALSE ! NOT MOVING BACK THRU PROMPTS END IF WHILE NOT VALID_ENTRY RECORD_FOUND = TRUE WHEN ERROR IN IF DEFAULT_RESTRICTED = "Y" THEN LINPUT #98%, & "Is this a restricted account? (Default of Y): ";& ENTERED_RESTRICTED ELSE LINPUT #98%, & "Is this a restricted account? (Default of N): ";& ENTERED_RESTRICTED END IF USE RECORD_FOUND = FALSE CONTINUE END WHEN IF NOT RECORD_FOUND THEN BACKWARDS = TRUE! MOVING BACK THRU PROMPTS ACTION_SEQ = ACTION_SEQ - 1% EXIT SUB END IF ! ----- UPPERCASE AND DISCARD ANY GARBAGE CHARS ----- ENTERED_RESTRICTED = EDIT$(ENTERED_RESTRICTED, 38%) IF ENTERED_RESTRICTED = "B" THEN BACKWARDS = TRUE! MOVING BACK THRU PROMPTS ACTION_SEQ = ACTION_SEQ - 1% EXIT SUB END IF ENTERED_RESTRICTED = DEFAULT_RESTRICTED & IF ENTERED_RESTRICTED = "" IF ENTERED_RESTRICTED <> "Y" AND & ENTERED_RESTRICTED <> "N" THEN PRINT PRINT "Error - Invalid response" + & TRM$(PLEASE_TRY_AGAIN) PRINT ITERATE END IF VALID_ENTRY = TRUE NEXT ! ----- CONTINUE WITH DESIRED PROMPT ----- ACTION_SEQ = ACTION_SEQ + 1% END SUB