*DECK BLDKWL
USETEXT NIPDEF
USETEXT KSTTAB
USETEXT KDIS
PROC BLDKWL((TYPE),(NUMBER1),(NUMBER2),(ID)); # FORMAT KWL #
STARTIMS;
STOPIMS;
#
INPUT PARAMETERS
#
ITEM TYPE S:KST; # STATUS DISPLAY BUFFER TYPE #
ITEM NUMBER1; # INDEX NUMBER 1, TERMINAL NODE NUMBER #
ITEM NUMBER2; # INDEX NUMBER 2 #
ITEM ID; # BUFFER IDENTIFIER #
ITEM I; # INDUCTION VARIABLE #
#
EXTERNAL REFERENCES
#
XREF
BEGIN
PROC MGETS; # GET BUFFER #
PROC XTRACE; # TRACE CALL #
END
#
LOCAL VARIABLES
#
ITEM BUFADDR; # BUFFER ADDRESS FOR KWL #
CONTROL EJECT;
BEGIN # BLDKWL #
CONTROL IFEQ DEBUG,1;
XTRACE("BDKWL"); # TRACE CALL #
CONTROL FI;
MGETS(L$KWL,BUFADDR,TRUE); # GET BUFFER FOR KWL #
P<KWL> = LOC(KWLPTR[0]);
FOR I=I WHILE KWL$NEXT[0] NQ 0
DO # SCAN FOR END OF KWL LIST #
BEGIN
P<KWL> = KWL$NEXT[0];
IF ID EQ KDELIDVALUE # REQUEST TO DELETE STATUS DISPLAY ENTRY #
AND KWL$ID[0] EQ KDELIDVALUE # QUEUED KWL IS A DELETE ENTRY #
AND KWL$TYPE[0] EQ TYPE # DELETE SAME TYPE OF ENTRY #
AND KWL$KNDX[0] LS NUMBER1 # LINE INDEX BELOW THAT OF REQUEST#
THEN # DECREMENT LINE INDEX TO DELETE BY 1 TO ADJUST FOR KDEL #
NUMBER1 = NUMBER1 - 1;
END
KWL$NEXT[0] = BUFADDR;
P<KWL> = BUFADDR; # FWA OF KWL #
KWL$ID[0] = ID; # SET BUFFER IDENTIFIER #
KWL$TYPE[0] = TYPE; # SET STATUS DISPLAY BUFFER TYPE #
KWL$TN[0] = NUMBER2;
KWL$HN[0] = NUMBER1;
RETURN;
END
TERM