Trailing-Edge
-
PDP-10 Archives
-
decuslib20-05
-
decus/20-0141/daipar.for
There are 2 other files named daipar.for in the archive. Click here to see a list.
SUBROUTINE DAIPAR( KNDBGN,KNDEND,KONECT,IBUFFR,
1 MAXBFR,LOWBFR,KIND ,NEWBGN,NEWEND,BGNNEW,ENDNEW)
C RENBR(/INTERPRET PAIR OF ASSOCIATED VALUES)
C
C DONALD BARTH, HARVARD BUSINESS SCHOOL
C
C FOLLOWING ARGUMENTS ARE USED FOR INPUT ONLY, AND ARE
C RETURNED UNCHANGED.
C
C KNDBGN = SPECIFIES WHETHER INDEX IS RETURNED AS
C INTEGER ARGUMENT NEWBGN OR AS REAL ARGUMENT
C BGNNEW. NUMBER CAN BE TYPED WITH DECIMAL
C POINT AND/OR EXPONENT REGARDLESS OF VALUE OF
C KNDBGN.
C = -1, INDEX IS CALCULATED AS OCTAL INTEGER AND
C IS RETURNED AS ARGUMENT NEWBGN. HOWEVER,
C NUMBER FOLLOWING LETTER E OF EXPONENT IS
C EVALUATED IN DECIMAL.
C = 0, INDEX IS CALCULATED AS DECIMAL INTEGER
C AND IS RETURNED AS ARGUMENT NEWBGN.
C = 1 OR GREATER, INDEX IS RETURNED AS REAL
C ARGUMENT BGNNEW. IF POSSIBLE, REAL NUMBER
C WILL BE ACCUMULATED AS INTEGER, THEN BE
C CONVERTED TO REAL AND SHIFTED AS NECESSARY.
C KNDBGN IS MAXIMUM NUMBER OF DIGITS IN
C INTEGER.
C KNDEND = SPECIFIES WHETHER ASSOCIATED VALUE IS
C RETURNED AS INTEGER ARGUMENT NEWEND OR AS
C REAL ARGUMENT ENDNEW. NUMBER CAN BE TYPED
C WITH DECIMAL POINT AND/OR EXPONENT
C REGARDLESS OF VALUE OF KNDEND.
C = -1, ASSOCIATED VALUE IS CALCULATED AS OCTAL
C INTEGER AND IS RETURNED AS ARGUMENT NEWEND.
C HOWEVER, NUMBER FOLLOWING LETTER E OF
C EXPONENT IS EVALUATED IN DECIMAL.
C = 0, ASSOCIATED VALUE IS CALCULATED AS DECIMAL
C INTEGER AND IS RETURNED AS ARGUMENT NEWEND.
C = 1 OR GREATER, ASSOCIATED VALUE IS RETURNED
C AS REAL ARGUMENT ENDNEW. IF POSSIBLE, REAL
C NUMBER WILL BE ACCUMULATED AS INTEGER, THEN
C BE CONVERTED TO REAL AND SHIFTED AS
C NECESSARY. KNDEND IS MAXIMUM NUMBER OF
C DIGITS IN INTEGER.
C
C
C
C KONECT = SPECIFIES MANNER OF INTERPRETATION OF
C FOLLOWING NUMBER WHEN PREVIOUS CALL HAS
C ALREADY RETURNED PAIR OF VALUES. KONECT
C ALSO SPECIFIES WHETHER COMMAS ARE TO
C INDICATE THAT FOLLOWING NUMBER, IF ANY, IS
C TO BE INDEX OF SUBSEQUENT PAIR, OR WHETHER
C COMMAS ARE ALLOWED BETWEEN SUBSEQUENT VALUES
C ASSOCIATED WITH SAME INDEX. REGARDLESS OF
C VALUE OF KONECT, ALL COMMAS APPEARING TO
C LEFT OF INDEX ARE IGNORED.
C = -1, 0 OR 1, COMMAS CANNOT APPEAR BETWEEN
C SPECIFICATION OF INDEX AND OF ITS ASSOCIATED
C VALUE AND CANNOT APPEAR BETWEEN
C REPRESENTATIONS OF SUBSEQUENT ASSOCIATED
C VALUES. IF COMMA IS FOUND, THEN FOLLOWING
C NUMBER, IF ANY, IS TAKEN TO BE INDEX OF
C SUBSEQUENT PAIR OF NUMBERS.
C = -1, WHEN PREVIOUS CALL HAS ALREADY RETURNED
C PAIR OF VALUES, FOLLOWING REPRESENTATION OF
C NUMBER ON SAME LINE IS TAKEN TO SPECIFY
C ADDITIONAL ASSOCIATED VALUE.
C
C IF END OF LINE IS FOUND INSTEAD OF FIRST
C ASSOCIATED VALUE, THEN CALLING PROGRAM CAN
C REQUEST (BY SETTING KIND=4 TO SIMULATE
C FINDING OF AMPERSAND) THAT EVALUATION OF
C ASSOCIATED VALUES IS TO BE CONTINUED BY NEXT
C CALL TO THIS ROUTINE IN NEW TEXT READ INTO
C INPUT BUFFER. IF END OF LINE IS FOUND
C BEFORE FIRST ASSOCIATED VALUE, BUT CALLING
C PROGRAM LEAVES KIND UNCHANGED BEFORE AGAIN
C CALLING THIS ROUTINE, THEN INDEX VALUE WILL
C BE RETURNED WITHOUT ASSOCIATED VALUE,
C FOLLOWING WHICH FIRST NUMBER IN NEW CONTENTS
C OF TEXT BUFFER WILL BE INTERPRETED AS INDEX
C OF NEW PAIR.
C
C IF AMPERSAND IS FOUND TO RIGHT OF INDEX
C SPECIFICATION, REGARDLESS OF WHETHER
C ASSOCIATED VALUE HAS BEEN FOUND BY PREVIOUS
C CALL, THEN EVALUATION OF ASSOCIATED VALUES
C WILL BE CONTINUED BY NEXT CALL TO THIS
C ROUTINE IN NEW TEXT READ INTO INPUT BUFFER.
C IF AMPERSAND IS FOUND PRIOR TO FIRST
C ASSOCIATED VALUE, BUT NEXT LINE READ INTO
C INPUT BUFFER IS TO START NEW PAIR, THEN KIND
C SHOULD BE SET TO 6 BY CALLING PROGRAM
C CAUSING INDEX TO BE GENERATED FIRST BUT
C MARKED AS HAVING MISSING ASSOCIATED VALUE.
C IF AMPERSAND IS FOUND AFTER ASSOCIATED VALUE
C HAS BEEN FOUND BY PREVIOUS CALL, BUT NEXT
C LINE READ INTO INPUT BUFFER IS TO START NEW
C PAIR, THEN KIND SHOULD BE SET TO ONE.
C
C = 0, WHEN PREVIOUS CALL HAS ALREADY RETURNED
C PAIR OF VALUES, FOLLOWING REPRESENTATION OF
C NUMBER ON SAME LINE CAUSES THIS ROUTINE TO
C REPORT MISSING COMMA, AND SUBSEQUENT CALL TO
C THIS ROUTINE THEN BEGINS EVALUATION OF THIS
C FOLLOWING NUMBER AS INDEX OF SUBSEQUENT
C PAIR.
C
C IF END OF LINE IS FOUND INSTEAD OF FIRST
C ASSOCIATED VALUE, THEN CALLING PROGRAM CAN
C REQUEST (BY SETTING KIND=4 TO SIMULATE
C FINDING OF AMPERSAND) THAT EVALUATION OF
C ASSOCIATED VALUE IS TO BE CONTINUED BY NEXT
C CALL TO THIS ROUTINE IN NEW TEXT READ INTO
C INPUT BUFFER. IF END OF LINE IS FOUND
C BEFORE FIRST ASSOCIATED VALUE, BUT CALLING
C PROGRAM LEAVES KIND UNCHANGED BEFORE AGAIN
C CALLING THIS ROUTINE, THEN INDEX VALUE WILL
C BE RETURNED WITHOUT ASSOCIATED VALUE,
C FOLLOWING WHICH FIRST NUMBER IN NEW CONTENTS
C OF TEXT BUFFER WILL BE INTERPRETED AS INDEX
C OF SUBSEQUENT PAIR.
C
C IF AMPERSAND IS FOUND BEFORE FIRST
C ASSOCIATED VALUE, THEN EVALUATION OF
C ASSOCIATED VALUE WILL BE CONTINUED BY NEXT
C CALL TO THIS ROUTINE IN NEW TEXT READ INTO
C INPUT BUFFER UNLESS CALLING PROGRAM SETS
C KIND TO 6 PRIOR TO SUBSEQUENT CALL TO THIS
C ROUTINE, CAUSING INDEX TO BE GENERATED BUT
C MARKED AS HAVING MISSING ASSOCIATED VALUE.
C IF AMPERSAND IS FOUND AFTER ASSOCIATED VALUE
C HAS BEEN FOUND, THEN FIRST NUMBER EVALUATED
C BY SUBSEQUENT CALL TO THIS ROUTINE IN NEW
C TEXT READ INTO INPUT BUFFER IS ASSUMED TO BE
C INDEX OF NEW PAIR OF VALUES.
C
C = 1, WHEN PREVIOUS CALL HAS ALREADY RETURNED
C PAIR OF VALUES, FOLLOWING REPRESENTATION OF
C NUMBER ON SAME LINE IS TAKEN TO SPECIFY
C ADDITIONAL ASSOCIATED VALUE.
C
C IF EITHER AMPERSAND OR END OF LINE IS FOUND
C BEFORE FIRST ASSOCIATED VALUE, THEN INDEX
C VALUE WILL BE RETURNED WITHOUT ASSOCIATED
C VALUE, FOLLOWING WHICH CALLING PROGRAM WILL
C BE INFORMED THAT END OF LINE OR AMPERSAND
C HAS BEEN REACHED.
C
C = 2, 3 OR 4, SAME AS WHEN KONECT=-1, 0 OR 1
C RESPECTIVELY, EXCEPT THAT COMMAS CAN APPEAR
C (BUT ARE NOT REQUIRED) BETWEEN
C REPRESENTATIONS OF INDEX AND FIRST
C ASSOCIATED VALUE AND BETWEEN REPRESENTATIONS
C OF SUBSEQUENT ASSOCIATED VALUES. EXTRA
C COMMA INDICATES MISSING ASSOCIATED VALUE.
C IF KONECT=3, AND IF PREVIOUS CALL RETURNED
C PAIR OF VALUES, THEN KIND WILL BE RETURNED
C SET TO 10 TO INDICATE MISSING SEMICOLON IF
C FOLLOWING NUMBER IS FOUND WHETHER OR NOT
C THIS FOLLOWING NUMBER IS PRECEDED BY COMMA,
C AND SUBSEQUENT CALL TO THIS ROUTINE WILL
C BEGIN EVALUATION OF FOLLOWING NUMBER AS
C INDEX OF SUBSEQUENT PAIR. UNLIKE COMMAS,
C SEMICOLONS ARE ALWAYS REPORTED TO CALLING
C PROGRAM REGARDLESS OF VALUE OF KONECT.
C
C IBUFFR = INPUT BUFFER ARRAY CONTAINING CHARACTERS
C TYPED BY USER, READ BY MULTIPLE OF A1
C FORMAT, WHICH IS TO BE SEARCHED FOR NUMBER
C SPECIFICATIONS. IBUFFR THEN CONTAINS ONE
C CHARACTER PER COMPUTER STORAGE LOCATION.
C
C MAXBFR = MAXIMUM SUBSCRIPT OF IBUFFR ARRAY LOCATIONS
C TO BE SEARCHED.
C
C FOLLOWING ARGUMENTS ARE USED BOTH FOR INPUT TO THIS
C ROUTINE, AND FOR OUTPUT TO CALLING PROGRAM.
C
C LOWBFR = INPUT CONTAINING SUBSCRIPT WITHIN IBUFFR
C ARRAY OF FIRST (LEFTMOST) CHARACTER WHICH
C CAN BE SCANNED FOR NUMBER SPECIFICATION.
C LOWBFR IS RETURNED POINTING TO NEXT
C CHARACTER WHICH WOULD BE INTERPRETED BY
C SUBSEQUENT CALL TO THIS ROUTINE IF THIS
C SUBSEQUENT CALL NEEDS TO EVALUATE FURTHER
C NUMBER SPECIFICATIONS. IF THERE ARE NO
C PRINTING CHARACTERS AT OR TO RIGHT OF
C IBUFFR(LOWBFR), BUT INTERPRETATION OF
C ADDITIONAL CHARACTERS IS ATTEMPTED, THEN
C LOWBFR WILL BE RETURNED CONTAINING MAXBFR+1.
C LOWBFR MUST BE RESET BY CALLING PROGRAM TO
C POINT TO FIRST CHARACTER IN IBUFFR ARRAY
C EACH TIME NEW LINE OF TEXT IS READ.
C
C KIND = INPUT CONTAINING -1, ERROR WAS DETECTED BY
C CALLING PROGRAM (RATHER THAN BY THIS
C ROUTINE) IN RESULTS RETURNED BY PREVIOUS
C CALL TO THIS ROUTINE AND ANY ADDITIONAL
C NUMBERS THROUGH NEXT APPEARANCE OF COMMA
C (UNLESS KONECT IS GREATER THAN 1) OR
C SEMICOLON OR AMPERSAND OR UNKNOWN CHARACTER
C OR END OF LINE ARE TO BE IGNORED. NEXT
C NUMBER TO RIGHT OF COMMA OR ON LINE
C FOLLOWING AMPERSAND OR END OF LINE IS TO BE
C INTERPRETED AS INDEX OF NEXT PAIR. UNKNOWN
C CHARACTER OR SEMICOLON IS REPORTED TO
C CALLING PROGRAM IF IT IS FOUND INSTEAD.
C = INPUT CONTAINING 0, THIS ROUTINE HAS NOT YET
C BEEN CALLED DURING EXECUTION OF CURRENT
C LOGICAL SECTION OF CALLING PROGRAM. THIS
C ROUTINE IS TO BEGIN EVALUATION OF CONTENTS
C OF INPUT TEXT BUFFER, NOT CONTINUE SEARCHING
C FOR VALUES ASSOCIATED WITH INDEX FOUND BY
C PREVIOUS CALL TO THIS ROUTINE. LOWBFR
C SHOULD POINT TO FIRST CHARACTER IN IBUFFR
C ARRAY TO BE INTERPRETED.
C = INPUT GREATER THAN ZERO, VALUE OF KIND
C INDICATES CONDITION RETURNED BY PREVIOUS
C CALL TO THIS ROUTINE AND IN MOST CASES HAS
C NOT BEEN MODIFIED BY CALLING PROGRAM. KIND
C BEING RETURNED WITH ONE OF VALUES 7, 8, 9 OR
C 10 (IF KONECT IS 2 OR 4) INDICATES THAT PAIR
C OF VALUES IS BEING RETURNED, ALTHOUGH EITHER
C OR BOTH MEMBERS OF PAIR COULD BE MISSING.
C OTHER VALUES OF KIND INDICATE SPECIAL
C CONDITIONS FOR WHICH PAIR OF NUMBERS IS NOT
C RETURNED.
C = 1, NOTHING, EXCEPT PERHAPS LEADING COMMAS OR
C ELSE COMMENT INDICATED BY LEADING
C EXCLAMATION POINT, WAS FOUND AT OR TO RIGHT
C OF IBUFFR(LOWBFR). CALLING PROGRAM SHOULD
C READ NEW LINE OF TEXT INTO IBUFFR.
C = 2, SEMICOLON WAS FOUND AS FIRST PRINTING
C CHARACTER AT OR TO RIGHT OF IBUFFR(LOWBFR).
C IF INDEX BUT NOT ASSOCIATED VALUE HAS BEEN
C FOUND WHEN SEMICOLON IS ENCOUNTERED, THEN
C INDEX IS REPORTED TO CALLING PROGRAM BEFORE
C SEMICOLON IS REPORTED. IT IS ASSUMED THAT
C CALLING PROGRAM WILL TREAT SEMICOLON AS
C MARKING END OF LOGICAL GROUP OF PAIR
C SPECIFICATIONS IF KONECT IS NOT GREATER THAN
C 1, OR END OF SINGLE PAIR SPECIFICATION IF
C KONECT IS GREATER THAN 1.
C = 3, AMPERSAND WAS FOUND WHILE SEARCHING FOR
C NEXT INDEX. LOWBFR IS RETURNED POINTING
C BEYOND END OF BUFFER. CALLING PROGRAM
C SHOULD READ NEW LINE OF TEXT INTO INPUT
C BUFFER BEFORE AGAIN CALLING THIS ROUTINE.
C THIS VALUE OF KIND IS NOT RETURNED IF
C AMPERSAND IS FOUND WHILE SEARCHING FOR
C ASSOCIATED VALUES.
C = 4, AMPERSAND WAS FOUND AFTER INDEX INSTEAD
C OF FIRST ASSOCIAED VALUE. CALLING PROGRAM
C SHOULD READ NEW LINE OF TEXT INTO BUFFER
C BEFORE AGAIN CALLING THIS ROUTINE.
C SUBSEQUENT CALL TO THIS ROUTINE WILL
C CONTINUE EVALUATION OF ASSOCIATED VALUES IN
C NEW CONTENTS OF BUFFER. IF SEMICOLON (OR
C COMMA IF KONECT IS NOT GREATER THAN 1) IS
C FOUND AT START OF NEW CONTENTS OF BUFFER,
C THEN INDEX VALUE WILL BE RETURNED TO CALLING
C PROGRAM BUT CALLING PROGRAM WILL BE INFORMED
C THAT ASSOCIATED VALUE IS MISSING. IF
C SUBSEQUENT CALL TO THIS ROUTINE IS INSTEAD
C TO BEGIN EVALUATION OF NEW SET OF LEADING
C INDEX AND ASSOCIATED VALUES, THEN CALLING
C PROGRAM SHOULD SET KIND TO 6 TO SIMULATE
C LACK OF AMPERSAND, CAUSING INDEX TO BE
C GENERATED, BUT MARKED AS HAVING MISSING
C ASSOCIATED VALUE. IF INDEX IS NOT WANTED,
C THEN KIND SHOULD BE SET TO ONE.
C = 5, PREVIOUS CALL HAS ALREADY RETURNED PAIR
C OF VALUES, BUT AMPERSAND WAS FOUND INSTEAD
C OF ANOTHER ASSOCIATED VALUE. CALLING
C PROGRAM SHOULD READ NEW LINE OF TEXT INTO
C BUFFER BEFORE AGAIN CALLING THIS ROUTINE.
C SUBSEQUENT CALL TO THIS ROUTINE WILL
C CONTINUE EVALUATION OF ASSOCIATED VALUES IN
C NEW CONTENTS OF BUFFER. SINCE INDEX HAS
C ALREADY BEEN RETURNED, NO ADDITIONAL MISSING
C VALUE WILL BE REPORTED IF SEMICOLON (OR
C COMMA IF KONECT IS NOT GREATER THAN 1) IS
C FOUND AT START OF NEW CONTENTS OF BUFFER.
C IF SUBSEQUENT CALL TO THIS ROUTINE IS ALWAYS
C TO BEGIN EVALUATION OF NEW PAIR OF VALUES,
C THEN CALLING PROGRAM SHOULD SET KIND TO ONE.
C = 6, END OF LINE WAS FOUND INSTEAD OF FIRST
C ASSOCIATED VALUE. IF KIND IS SENT UNCHANGED
C TO SUBSEQUENT CALL OF THIS ROUTINE, THEN
C INDEX WILL BE RETURNED TO CALLING PROGRAM,
C BUT CALLING PROGRAM WILL BE INFORMED THAT
C ASSOCIATED VALUE IS MISSING. IF SUBSEQUENT
C CALL TO THIS ROUTINE IS INSTEAD TO CONTINUE
C EVALUATION OF ASSOCIATED VALUES IN NEW
C CONTENTS OF BUFFER READ BY CALLING PROGRAM
C BEFORE THIS ROUTINE IS AGAIN CALLED, THEN
C KIND SHOULD BE SET TO 4 TO SIMULATE
C APPEARANCE OF AMPERSAND AT END OF PRECEDING
C LINE. IF INDEX IS NOT WANTED, THEN KIND
C SHOULD BE SET TO ONE.
C = 7, BOTH INDEX AND ASSOCIATED VALUE ARE BEING
C RETURNED TO CALLING PROGRAM.
C = 8, INDEX IS BEING RETURNED TO CALLING
C PROGRAM, BUT ASSOCIATED VALUE IS MISSING.
C NEWEND AND ENDNEW ARE RETURNED UNDEFINED.
C = 9, ASSOCIATED VALUE IS BEING RETURNED TO
C CALLING PROGRAM, BUT INDEX HAS ALREADY BEEN
C RETURNED BY PREVIOUS CALL. NEWBGN OR
C BGNNEW, WHICHEVER IS APPROPRIATE, IS
C RETURNED UNCHANGED (BUT CAN BE MODIFIED AS
C DESIRED BY CALLING PROGRAM).
C = 10, NEVER RETURNED IF KONECT=-1 OR 1.
C
C IF KONECT HAS EITHER OF VALUES 2 OR 4, PAIR
C OF VALUES HAS ALREADY BEEN RETURNED BY
C PREVIOUS CALL, BUT EXTRA COMMA WAS FOUND
C INDICATING MISSING ASSOCIATED VALUE. NEWBGN
C OR BGNNEW, WHICHEVER IS APPROPRIATE, IS
C RETURNED UNCHANGED (BUT CAN BE MODIFIED AS
C DESIRED BY CALLING PROGRAM).
C
C IF KONECT=0, THEN PAIR OF VALUES HAS ALREADY
C BEEN RETURNED BY PREVIOUS CALL, BUT
C FOLLOWING NUMBER WAS FOUND WHICH WAS NOT
C PRECEDED BY COMMA. KIND SHOULD BE SET TO -1
C BY CALLING PROGRAM BEFORE THIS ROUTINE IS
C CALLED NEXT IF LACK OF COMMA INDICATES
C SERIOUS ENOUGH ERROR THAT ALL NUMBERS SHOULD
C BE IGNORED UNTIL NEXT COMMA IS FOUND. IF
C KONECT=3, THEN PAIR OF VALUES HAS ALREADY
C BEEN RETURNED BY PREVIOUS CALL, BUT
C FOLLOWING NUMBER WAS FOUND WHICH WAS NOT
C PRECEDED BY SEMICOLON, BUT WHICH MAY OR MAY
C NOT HAVE BEEN PRECEDED BY ONE OR MORE
C COMMAS. KIND SHOULD BE SET TO -1 BY CALLING
C PROGRAM BEFORE THIS ROUTINE IS CALLED NEXT
C IF LACK OF SEMICOLON INDICATES SERIOUS
C ENOUGH ERROR THAT ALL NUMBERS SHOULD BE
C IGNORED UNTIL NEXT SEMICOLON IS FOUND. IF
C KONECT IS 0 OR 3, THEN LOWBFR IS RETURNED
C POINTING TO FIRST CHARACTER OF NUMBER
C SPECIFICATION, AND NUMBER WILL BE EVALUATED
C AS INDEX IF THIS ROUTINE IS CALLED AGAIN
C WITHOUT KIND HAVING BEEN CHANGED.
C = 11, UNKNOWN CHARACTER WAS FOUND. IF THIS
C APPEARS BEFORE FIRST ASSOCIATED VALUE, THEN
C INDEX IS REPORTED TO CALLING PROGRAM BEFORE
C UNKNOWN CHARACTER IS REPORTED. LOWBFR IS
C RETURNED POINTING TO NEXT CHARACTER TO RIGHT
C OF UNKNOWN CHARACTER. IF THIS ROUTINE IS
C CALLED WITHOUT CHANGING VALUE OF KIND, THEN
C NUMBER TO RIGHT OF UNKNOWN CHARACTER WILL BE
C INTERPRETED AS INDEX OF NEXT PAIR.
C
C NEWBGN = RETURNED CONTAINING NEXT VALUE OF INTEGER
C INDEX IF KIND IS RETURNED CONTAINING EITHER
C 7 OR 8 AND IF KNDBGN IS LESS THAN OR EQUAL
C TO ZERO. NEWBGN IS NOT CHANGED IF KIND IS
C RETURNED CONTAINING EITHER 9 OR 10. NEWBGN
C CAN BE CHANGED AS REQUIRED BY THE CALLING
C PROGRAM.
C
C NEWEND = RETURNED CONTAINING NEXT ASSOCIATED INTEGER
C VALUE IF KIND IS RETURNED CONTAINING EITHER
C 7 OR 9 AND IF KNDEND IS LESS THAN OR EQUAL
C TO ZERO. NEWEND CAN BE RETURNED CHANGED BY
C THIS ROUTINE EVEN IF ASSOCIATED VALUE IS NOT
C FOUND BUT THEN MUST NOT BE CHANGED BY
C CALLING PROGRAM. IF AMPERSAND OR END OF
C LINE IS FOUND INSTEAD OF ASSOCIATED VALUE,
C THEN NEWEND INDICATES TO SUBSEQUENT CALL
C WHETHER COMMA WAS FOUND BEFORE AMPERSAND OR
C END OF LINE.
C
C BGNNEW = RETURNED CONTAINING VALUE OF REAL INDEX IF
C KIND IS RETURNED CONTAINING EITHER 7 OR 8
C AND IF KNDBGN IS GREATER THAN ZERO. BGNNEW
C IS NOT CHANGED IF KIND IS RETURNED
C CONTAINING EITHER 9 OR 10. BGNNEW CAN BE
C CHANGED AS REQUIRED BY THE CALLING PROGRAM.
C
C ENDNEW = RETURNED CONTAINING NEXT ASSOCIATED REAL
C VALUE IF KIND IS RETURNED CONTAINING EITHER
C 7 OR 9 AND IF KNDEND IS GREATER THAN ZERO.
C
DIMENSION IBUFFR(MAXBFR)
DATA KOMENT,IEND,IAND,KOMMA,IBLANK,ITAB/
11H!,1H;,1H&,1H,,1H ,1H /
C
C TEST IF ARE CONTINUING PREVIOUSLY EVALUATED VALUES
MISSIN=0
IKNCT=KONECT
IF(IKNCT.GT.1)IKNCT=IKNCT-3
IF(KIND.LE.0)GO TO 21
IF(KIND.GT.10)GO TO 21
GO TO(21,21,21, 6, 4,32, 2, 1,10, 3),KIND
1 IF(NEWEND.LE.0)GO TO 21
2 KIND=9
3 IF(IKNCT.EQ.0)GO TO 21
GO TO 5
4 MISSIN=NEWEND
5 KIND=9
GO TO 10
6 MISSIN=NEWEND
7 KIND=7
GO TO 10
8 IF(KONECT.LE.1)GO TO 18
IF(MISSIN.GT.0)GO TO 31
MISSIN=1
9 LOWBFR=LOWBFR+1
10 IF(LOWBFR.GT.MAXBFR)GO TO 15
LETTER=IBUFFR(LOWBFR)
IF(LETTER.EQ.IBLANK)GO TO 9
IF(LETTER.EQ.ITAB)GO TO 9
IF(LETTER.EQ.KOMMA)GO TO 8
IF(LETTER.EQ.KOMENT)GO TO 14
IF(LETTER.EQ.IEND)GO TO 13
IF(LETTER.EQ.IAND)GO TO 11
C
C EVALUATE NEXT ASSOCIATED VALUE
CALL DAHEFT(KNDEND,1,0,IBUFFR,MAXBFR,
1LOWBFR,ITYPE,ISHIFT,JSHIFT,KSHIFT,LSHIFT,NEWEND,
2ENDNEW)
IF(ITYPE.EQ.3)GO TO 36
IF(KIND.EQ.7)GO TO 32
GO TO 35
C
C AMPERSAND FOUND INSTEAD OF ASSOCIATED VALUE
11 IF(KIND.EQ.7)GO TO 12
IF(IKNCT.GT.0)GO TO 25
GO TO 27
12 IF(IKNCT.GT.0)GO TO 32
GO TO 26
C
C SEMICOLON FOUND INSTEAD OF ASSSOCIATED VALUE
13 IF(KIND.EQ.7)GO TO 32
IF(MISSIN.GT.0)GO TO 34
GO TO 24
C
C NO ASSOCIATED VALUE FOUND
14 LOWBFR=MAXBFR+1
15 IF(KIND.EQ.7)GO TO 16
IF(MISSIN.GT.0)GO TO 34
GO TO 23
16 IF(IKNCT.GT.0)GO TO 32
GO TO 29
C
C COMMA FOUND INSTEAD OF ASSOCIATED VALUE
17 IF(KONECT.LE.1)GO TO 19
GO TO 20
18 IF(KIND.EQ.7)GO TO 32
19 KIND=7
C
C FIND NEXT PAIR OF SERIES
20 LOWBFR=LOWBFR+1
21 IF(LOWBFR.GT.MAXBFR)GO TO 23
LETTER=IBUFFR(LOWBFR)
IF(LETTER.EQ.IBLANK)GO TO 20
IF(LETTER.EQ.ITAB)GO TO 20
IF(LETTER.EQ.KOMMA)GO TO 17
IF(LETTER.EQ.KOMENT)GO TO 22
IF(LETTER.EQ.IEND)GO TO 24
IF(LETTER.EQ.IAND)GO TO 25
C
C OBTAIN LEADING VALUE
INIBFR=LOWBFR
CALL DAHEFT(KNDBGN,1,0,IBUFFR,MAXBFR,
1LOWBFR,ITYPE,ISHIFT,JSHIFT,KSHIFT,LSHIFT,NEWBGN,
2BGNNEW)
IF(ITYPE.NE.3)GO TO 35
IF(KIND.LT.0)GO TO 21
IF(KIND.NE.9)GO TO 7
LOWBFR=INIBFR
GO TO 34
C
C RETURN TO CALLING PROGRAM
22 LOWBFR=MAXBFR+1
23 KIND=1
GO TO 36
24 KIND=2
LOWBFR=LOWBFR+1
GO TO 36
25 KIND=3
LOWBFR=MAXBFR+1
GO TO 36
26 KIND=4
GO TO 28
27 KIND=5
28 LOWBFR=MAXBFR+1
GO TO 30
29 KIND=6
30 NEWEND=MISSIN
GO TO 36
31 IF(KIND.EQ.9)GO TO 34
NEWEND=1
GO TO 33
32 NEWEND=0
33 KIND=8
GO TO 36
34 KIND=10
GO TO 36
35 LOWBFR=LOWBFR+1
KIND=11
36 RETURN
C610242504579!;&
END