*DECK NP$XLCH
*IF,DEF,XFR
USETEXT NX$ACBF
USETEXT AIPDEF
USETEXT HEADER
USETEXT NP$STAT
USETEXT NP$DB
USETEXT NP$NWL
USETEXT NP$MODE
USETEXT NP$GETS
USETEXT NX$ACBX
PROC NP$XLCH(NPCHKMARK,CHENTRY);
BEGIN
#
**
* 1. PROC NAME AUTHOR DATE
*
* NP$XLCH Y. C. YIP 02/16/1984
*
* 2. FUNCTIONAL DESCRIPTION.
*
* NP$XLCH USES THE CHECKMARK NUMBER AND SEARCHES THE
* CHECKMARK TABLE, RETURNING THE ENTRY OF THE CHECKMARK TABLE
* IN THE RETURN PARAMETER CHENTRY.
*
* 3. METHOD USED.
*
* NP$XLCH SCANS THROUGH THE CHECKMARK TABLE AND EITHER
* RETURN THE ENTRY NUMBER OF THE TABLE WHEN IT FINDS A
* MATCH WITH CHECKMARK NUMBER IN THE TABLE OR IF NO MATCH
* IS FOUND OR IF THE TABLE IS EMPTY THEN IT RETURNS ENTRY 0
* TO THE CALLER. THE RETURN PARAMETER IN ALL CASES IS CHENTRY.
*
* 4. ENTRY CONDITIONS:
*
* NPCHKMARK = CHECK MARK NUMBER TO BE SEARCHED.
* CHENTRY = RETURN PARAMETER.
*
*
* 5. EXIT CONDITIONS:
*
* NPCHKMARK IS UNCHANGED.
* CHENTRY = ENTRY OF THE MATCHED CHECKMARK.
* IF CHENTRY IS ZERO THEN NO MATCH IS FOUND.
#
#
****
#
XREF
BEGIN
END
#
****
#
ITEM NPCHKMARK; # CHECK MARK TO BE MATCHED #
ITEM CHENTRY; # RETURN PARAMETER #
ITEM INDEX; # LOOP INDEX #
ITEM FOUND B; # FLAG FOR LOCATING THE ENTRY #
CONTROL EJECT;
#
************************************************************************
* *
* CODE OF PROC NP$XLCH BEGINS HERE *
* *
************************************************************************
#
P<CHK> = FTTCKTBL[FTTINDEX]; # PULL CHECKMARK TABLE TEMPLAT#
# TO ITS ADDRESS IN FTT #
CHENTRY = 1; # INITIALIZE ENTRY TO DEFAULT #
# CHECKMARK ENTRY #
FOUND = FALSE; # SET FLAG TO FALSE #
IF CHK$IDX[0] GQ CHK$START # IF CHECK MARK TABLE NOT #
# EMPTY #
THEN
BEGIN
FOR INDEX = CHK$START STEP 1 WHILE NOT FOUND
DO
BEGIN
IF NPCHKMARK EQ CHK$MARK[INDEX] # MATCH FOUND #
THEN
BEGIN
FOUND = TRUE; # SET FLAG #
CHENTRY = INDEX; # SAVE ENTRY IN RETURN #
END # PARAMETER #
ELSE
BEGIN
IF INDEX EQ CHK$IDX[0] # LAST ENTRY ALREADY #
THEN
BEGIN
FOUND = TRUE; # SET FLAG TO EXIT #
END
END
END # END WHILE #
END # END IF #
RETURN; # RETURN TO CALLER #
END # END OF PROC NP$XLCH #
TERM
*ENDIF