12000 !-------------------------------------------------------------------- & ! & ! & ! Load the Sublist Definition Area & ! & !-------------------------------------------------------------------- & ! & ! input: MAX.LINES% max num lines per sublist (in COMCON) & ! M11.SUBLIST.NAME$ Sublist name (in COMVAR) & ! & ! output: M11.LAST.LINE% the number of the last filled line & ! SEL.- the sublist definition variables & ! & ! local variables: & ! & ! LINE$ contents of sublist record & ! LINE% line number of the sublist line & ! LINE.IN.REC% offset within the sublist record 0-7 & ! MAX.REC% maximum possible number of sublist & ! records & ! Z9$ working variable & ! & ! assumptions: & ! & ! * 8 lines per sublist record & ! (there can be no more than 9 lines) & ! & ! * calling routine has already checked that the sublist & ! is there & ! & ! * sublist has an 'END' indicator & ! & !-------------------------------------------------------------------- & 12020 SEL.ACC.REJ$(LINE%) = "" FOR LINE% = 0% TO MAX.LINES% & \ LINE% = 0% & \ MAX.REC% = MAX.LINES% / 8% + 1% & ! Initially, the entire array is nulled out. & ! Calculate the maximum number of records, based on the maximum & ! number of sublist lines (taking into account the 'END' line and & ! integer truncation). & 12030 ON ERROR GO TO 12090 & \ FOR REC% = 1% TO MAX.REC% & \ Z9$ = "0000" + NUM1$ (REC%) & \ SUB.KEY0$ = SUB.CHR$ + M11.SUBLIST.NAME$ + Z9$ & ! For each sublist record in the database ... & ! Right justify and zero fill record key. & 12035 GET #CH.ADD%, KEY #0% EQ SUB.KEY0$ & \ SUB.ALL$ = MLF.ALL$ & ! If the GET is unsuccessful, error traps to 12090. & 12040 FOR LINE.IN.REC% = 0% TO 7% & \ LINE$ = SUB.LINE$(LINE.IN.REC%) & \ GO TO 12099 IF SEG$ (LINE$, 1%, 3%) = "END" & \ LINE% = LINE% + 1% & ! Check for the end of the list. & 12050 SEL.FIELD.NUM$(LINE%) = SEG$ (LINE$, 1%, 2%) & \ SEL.PR.CODE$(LINE%) = SEG$ (LINE$, 3%, 3%) & \ SEL.OP.CODE$(LINE%) = SEG$ (LINE$, 4%, 4%) & \ SEL.ACC.REJ$(LINE%) = SEG$ (LINE$, 5%, 5%) & !* SEL.FUTURE$(LINE%) = SEG$ (LINE$, 6%, 6%) & \ SEL.VALUE.1$(LINE%) = SEG$ (LINE$, 7%, 22%) & \ SEL.VALUE.2$(LINE%) = SEG$ (LINE$, 23%, 38%) & ! Fill up definition area. & 12070 NEXT LINE.IN.REC% & 12080 NEXT REC% & \ GO TO 12099 & ! Jump around error trap. 12090 IF ERL = 12035% & THEN IF ERR = 154% & THEN M11.MSG$ = "Another user is using that record. Please wait." & \ GOSUB 14800 & \ RESUME 12035 & ELSE IF ERR = 155% OR ERR = 11% & THEN RESUME 12099 & ! If the error is a locked sublist record, then print message and try & ! again. If there are no more sublist definition records, then we're & ! done ... resume at 12099. 12099 ON ERROR GO TO 19000 & \ M11.LAST.LINE% = LINE% & \ UNLOCK #CH.ADD% & \ RETURN & ! Reset error trapping to 19000. Reset last line pointer. Unlock the & ! the last record retrieved and go back. &