! ----- KGB_IDENT_REC_EXISTS.FUN ----- ! ! ----- FUNCTION TO SEE IF THE VALUE IN KGB_IDENTIFIER ----- ! ----- ALREADY EXISTS AS AN IDENTIFIER RECORD ON A SPECIFIC ----- ! ----- I/O CHANNEL ----- ! ! ----- Last Change 07/02/93 by Brian Lomasky ----- ! FUNCTION WORD KGB_IDENT_REC_EXISTS(WORD THE_CHNL) %INCLUDE "NUSER.INC" DECLARE WORD ERR_FLAG ! ERROR FLAG DECLARE WORD FIRST_RECORD_WANTED! TRUE IF FIRST RECORD WANTED DECLARE WORD FOUND_IDENT ! CODE FOR MATCHING RECORD EXTERNAL WORD FUNCTION READ_RIGHTSLIST(WORD, & WORD) ! READ RIGHTSLIST RECORD ! ----- STORE IDENTIFIER VALUE TO SEARCH FOR ----- SEARCH_IDENTIFIER = KGB_IDENTIFIER ERR_FLAG = FALSE FIRST_RECORD_WANTED = TRUE FOUND_IDENT = 0% ! ASSUME NO IDENTIFIER REC FOUND WHILE NOT ERR_FLAG IF READ_RIGHTSLIST(FIRST_RECORD_WANTED, THE_CHNL) THEN ERR_FLAG = TRUE ITERATE END IF FIRST_RECORD_WANTED = FALSE ! ----- SEE IF DONE WITH THIS IDENTIFIER ----- IF SEARCH_IDENTIFIER <> KGB_IDENTIFIER THEN ERR_FLAG = TRUE ITERATE END IF ! ----- SKIP IF NON-IDENTIFIER RECORD ----- ITERATE IF REC_LEN < 48% ITERATE IF KGB_HOLDER(0%) <> 0% ERR_FLAG = TRUE ! SET FLAG TO EXIT LOOP FOUND_IDENT = 1% ! SET "IDENTIFIER FOUND" FLAG NEXT UNLOCK #THE_CHNL IF FOUND_IDENT = 1% THEN KGB_IDENT_REC_EXISTS = TRUE ELSE KGB_IDENT_REC_EXISTS = FALSE END IF ! ----- RESTORE THE ORIGINAL IDENTIFIER VALUE ----- KGB_IDENTIFIER = SEARCH_IDENTIFIER END FUNCTION