! ----- NUSER_OTHER_STUB.FUN ----- ! ! ----- Minimum stub file to be used when no DBMS nor 4GL ----- ! ----- non-standard NUSER processing needs to be performed ----- ! ! ---------- PASSED: ---------- ! ! ----- OTHER_ACTION = Action to be performed. One of: ! ----- GET_DIVISIONAL_IDENT = Prompt for divisional ! ----- file access for this user ! ! ----- ACTION_INDEX = User-entered program action array index ! ! ----- BACKWARDS = TRUE if we're moving backwards thru prompts ! ! ----- DEBUG_MODE = TRUE if Debug Mode was enabled ! ! ----- DIV = User-entered division for this user ! ! ----- PLEASE_TRY_AGAIN = "Please Try Again" error message ! ! ----- USER_ACTIONS(ACTION_INDEX) = Main Program action ! ! ----- (All other passed parameters are ignored) ----- ! ! ---------- RETURNED: ---------- ! ! ----- OTHER_PARAM1 = For "GET_DIVISIONAL_IDENT": 4-char ! ----- divisional identifier to be ! ----- granted to this user ! ! ----- ACTION_SEQ = Next User Input Sequence routine (999 if ! ----- done with all user prompting) ! ! ----- NUSER_OTHER will always return FALSE ----- ! ! ----- Last Change 11/21/94 by Brian Lomasky ----- ! FUNCTION WORD NUSER_OTHER(STRING OTHER_ACTION, & STRING OTHER_PARAM1, STRING OTHER_PARAM2) %INCLUDE "NUSER.INC" DECLARE LONG LOCAL_STATUS ! LOCAL SYSTEM SERVICE EXIT STAT DECLARE WORD RECORD_FOUND ! TRUE IF MATCHING RECORD FOUND DECLARE STRING TEMP_STRING ! TEMPORARY STRING DECLARE STRING TRANSLATED_NAME ! LOGICAL_NAME TRANSLATION DECLARE WORD VALID_ENTRY ! TRUE IF VALID ENTRY EXTERNAL LONG FUNCTION LOGICAL_NAME(STRING, & STRING) ! TRANSLATE LOGICAL NAME IF DEBUG_MODE THEN PRINT "NUSER_OTHER DEBUG>OTHER_ACTION="; OTHER_ACTION PRINT "NUSER_OTHER DEBUG>OTHER_PARAM1="; OTHER_PARAM1 PRINT "NUSER_OTHER DEBUG>OTHER_PARAM2="; OTHER_PARAM2 END IF SELECT OTHER_ACTION CASE "GET_DIVISIONAL_IDENT" IF DIV = "OTH" THEN IF BACKWARDS THEN ACTION_SEQ = ACTION_SEQ - 1% ! ----- RETURN SUCCESS STATUS ----- NUSER_OTHER = FALSE EXIT FUNCTION END IF VALID_ENTRY = TRUE OTHER_PARAM1 = DIV + "U" ELSE ! ----- TRY TO TRANSLATE ANY divOPR ----- ! ----- LOGICAL NAME ----- TEMP_STRING = DIV + "OPR" IF DEBUG_MODE THEN PRINT "DEBUG>TRANSLATE " + TEMP_STRING END IF LOCAL_STATUS = LOGICAL_NAME( & TEMP_STRING, TRANSLATED_NAME) SELECT LOCAL_STATUS CASE SS$_NOLOGNAM ! ----- IF NO LOGICAL EQUIVALENT ----- VALID_ENTRY = TRUE OTHER_PARAM1 = DIV + "U" CASE SS$_NORMAL VALID_ENTRY = FALSE CASE ELSE PRINT "Unexpected error" + & " while trying to" + & " translate " + & TEMP_STRING + BEL CALL LIB$STOP(LOCAL_STATUS BY VALUE) END SELECT END IF WHILE NOT VALID_ENTRY ! ----- WE ARE NOT GOING BACKWARDS ----- BACKWARDS = FALSE RECORD_FOUND = TRUE PRINT PRINT "What kind of access does this" + & " user require to the" + & " directories containing the" PRINT DIV + " division's User-Controlled files?" PRINT " Enter W for access to " + & DIV + "W files," PRINT " R for access to " + & DIV + "R files, or" PRINT " N for access to " + & DIV + "N files" PRINT WHEN ERROR IN IF DIV = "PGM" THEN LINPUT #98%, & "Enter W, R, or N (Default of W): "; & OTHER_PARAM1 ELSE LINPUT #98%, & "Enter W, R, or N (Default of R): "; & OTHER_PARAM1 END IF USE RECORD_FOUND = FALSE CONTINUE END WHEN IF NOT RECORD_FOUND THEN ! ----- MOVING BACK THRU PROMPTS ----- BACKWARDS = TRUE ACTION_SEQ = ACTION_SEQ - 1% ! ----- RETURN SUCCESS STATUS ----- NUSER_OTHER = FALSE EXIT FUNCTION END IF ! ----- UPPERCASE AND DISCARD ANY GARBAGE ----- ! ----- CHARS ----- OTHER_PARAM1 = EDIT$(OTHER_PARAM1, 38%) IF DIV = "PGM" THEN OTHER_PARAM1 = "W" IF OTHER_PARAM1 = "" ELSE OTHER_PARAM1 = "R" IF OTHER_PARAM1 = "" END IF IF OTHER_PARAM1 = "B" THEN ! ----- MOVING BACK THRU PROMPTS ----- BACKWARDS = TRUE ACTION_SEQ = ACTION_SEQ - 1% ! ----- RETURN SUCCESS STATUS ----- NUSER_OTHER = FALSE EXIT FUNCTION END IF SELECT OTHER_PARAM1 CASE "R" OTHER_PARAM1 = DIV + "R" CASE "W" OTHER_PARAM1 = DIV + "W" CASE "N" OTHER_PARAM1 = DIV + "U" CASE ELSE PRINT PRINT "Error - Invalid" + & " response" + & TRM$(PLEASE_TRY_AGAIN) PRINT ITERATE END SELECT VALID_ENTRY = TRUE NEXT ! ----- CONTINUE WITH DESIRED PROMPT ----- ACTION_SEQ = ACTION_SEQ + 1% ! ----- DONE IF WE ARE CHANGING ACCESS TO ----- ! ----- DIVISION-SPECIFIC FILES IF USER_ACTIONS(ACTION_INDEX) = "F" THEN ACTION_SEQ = 999% END IF CASE ELSE IF BACKWARDS THEN ACTION_SEQ = ACTION_SEQ - 1% ELSE ACTION_SEQ = ACTION_SEQ + 1% END IF NUSER_OTHER = FALSE ! ALWAYS RETURN FALSE END SELECT END FUNCTION