*DECK KUPVTAB
USETEXT NIPDEF
USETEXT KDIS
USETEXT KSTTAB
PROC KUPVTAB; # UPDATE VIEW TABLE #
STARTIMS;
#
*1DC KUPVTAB
*
* 1.PROC NAME AUTHOR DATE
* KUPVTAB M.GIBIAN 84/01/20
*
* 2.FUNCTIONAL DESCRIPTION
*
* UPDATE VIEW TABLE TO REFLECT KDVWLN DISPLAY STARTING FROM
* FIRST NON-ZERO STARTING INDEX.
*
* 3.METHOD USED
*
* FOR EACH TYPE OF STRUCTURE IN THE DISPLAY (APP, EST, LGL),
* SET THE END INDEX TO THE MIN(REMAINING LINES IN VIEW WINDOW,
* MAXIMUM LINES FOR THIS TYPE)
* IF MORE LINES IN VIEW THEN SET NEXT START INDEX TO 1
* ELSE SET NEXT START INDEX TO 0
* IF STRUCTURE NOT BEING DISPLAYED, SET END INDEX TO 0.
*
*
* 4.ENTRY PARAMETERS.
*
* 5.OUTPUT PARAMETERS.
*
* 6.COMDECKS AND TEXTS USED.
*
* NIPDEF KDIS KSTTAB
*
* 7.ROUTINES CALLED
*
* XTRACE RECORD PROCESSOR CALLS
*
* 8.DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
*
#
STOPIMS;
#
EXTERNAL CALLS
#
#
INTERNAL VARIABLES
#
ITEM KREM I=0; # WORKING REMAINING LENGTH IN VIEW BUFFER #
ITEM I I;
ITEM J I;
BASED ARRAY INDEXES S(1);
BEGIN
ITEM ISTART U(0,9,9); # START INDEX FIELD IN VIEW TABLE ARRAY #
ITEM IEND U(0,18,9); # END INDEX FIELD IN VIEW TABLE ARRAY #
ITEM IMAX U(0,27,9); # MAX INDEX FIELD IN VIEW TABLE ARRAY #
END
XREF BEGIN
PROC XTRACE;
END
BEGIN
CONTROL IFEQ DEBUG,1;
XTRACE("KUPVT");
CONTROL FI;
#
ADJUST THE VIEW TABLE, USING THE FIRST NONZERO START LOCATION AS THE
BASE (FIRST) LINE OF THE DISPLAY
#
P<INDEXES>=LOC(KDAPPST[0])-1;
KREM = KDVWLN[0];
FOR I=KST"APP" STEP 1 UNTIL KST"LLK" DO IF ISTART[I] GR 0 THEN
BEGIN
IF ISTART[I] GR IMAX[I] THEN
ISTART[I]=IMAX[I];
IF IMAX[I] LQ KREM+ISTART[I]-1 THEN
IEND[I]=IMAX[I];
ELSE
IEND[I]=KREM+ISTART[I]-1;
KREM=KREM-(IEND[I]-ISTART[I]+1);
IF KREM GR 0 AND I LS KST"LLK" THEN
ISTART[I+1] = 1;
ELSE
FOR J=I+1 STEP 1 UNTIL KST"LLK" DO ISTART[J]=0;
END
ELSE
IEND[I]= 0;
END
TERM