Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-08 - 43,50476/danext.for
There are 2 other files named danext.for in the archive. Click here to see a list.
      SUBROUTINE DANEXT(KONTRL,SLACK ,IBUFFR,MAXBFR,LOWBFR,
     1    MANY  ,KIND  ,NEWVAL,INCVAL,LMTVAL,VALNEW,VALINC,
     2    VALLMT)
C     RENBR(/RETURNS NEXT NUMBER IN SERIES)
C
C     DONALD BARTH, HARVARD BUSINESS SCHOOL
C
C     DANEXT RETURNS TO THE CALLING PROGRAM THE NEXT NUMBER
C     REPRESENTED BY THE CHARACTERS IN AN INPUT BUFFER READ
C     BY THE CALLING PROGRAM  WITH  A  MULTIPLE  OF  AN  A1
C     FORMAT.   IF A SERIES SPECIFICATION IS ENCOUNTERED IN
C     THE INPUT BUFFER, THEN THE INDIVIDUAL NUMBERS OF  THE
C     SERIES  ARE  RETURNED  BY  THE CALLS TO THIS ROUTINE.
C     WHEN ALL OF THE NUMBERS FORMING THE SERIES HAVE  BEEN
C     RETURNED,  THEN  THE  SUBSEQUENT  NUMBER OR SERIES OF
C     NUMBERS SPECIFIED BY THE CONTENTS OF THE  BUFFER  ARE
C     EVALUATED.
C
C     A SERIES EVALUATED BY THIS ROUTINE CAN BE WRITTEN  AS
C     A LOWER BOUND, INCREMENT AND UPPER BOUND SEPARATED BY
C     SLASHES.  IF THE INCREMENT IS TO  BE  ONE,  THEN  THE
C     LOWER  AND  UPPER  BOUNDS NEED BE SEPARATED ONLY BY A
C     SINGLE SLASH.  IF EITHER  BOUND  IS  MISSING,  IT  IS
C     ASSUMED  TO  BE  ZERO.   THE LOWER BOUND IS THE FIRST
C     NUMBER OF THE SERIES REPORTED TO THE CALLING PROGRAM.
C     THE  SERIES  CAN  THEN  EITHER  INCREASE  OR DECREASE
C     DEPENDING UPON WHETHER THE UPPER BOUND IS LESS  THAN,
C     EQUAL  TO, OR GREATER THAN THE LOWER BOUND.  THE SIGN
C     OF THE INCREMENT IS CHANGED IF IT DOES NOT CONFORM TO
C     THE RELATIVE VALUES OF THE BOUNDS.
C
C     IF THE SERIES IS TO CONSIST OF SEVERAL REPETITIONS OF
C     THE SAME VALUE, THEN THE SERIES IS INSTEAD WRITTEN AS
C     THE NUMBER OF TIMES THE VALUE IS TO BE USED  FOLLOWED
C     IMMEDIATELY BY AN ASTERISK AND THE VALUE ITSELF.  THE
C     VALUE TO BE REPEATED IS ASSUMED TO BE NULL IF  IT  IS
C     MISSING.
C
C     TWO VERSIONS OF THE ROUTINE ARE SUPPLIED.  DANEXT CAN
C     EVALUATE  REAL  NUMBERS AS WELL AS INTEGERS INCLUDING
C     E, K AND M NOTATIONS FOR SPECIFYING EITHER OF  THESE.
C     IF  THE  CALLING PROGRAM DOES NOT OTHERWISE REFERENCE
C     THE  FREE  FORMAT  INPUT  ROUTINE  DAREAD,   IF   THE
C     EVALUATION  OF  REAL  NUMBERS  IS  NOT NEEDED, AND IF
C     INTEGERS CAN BE SPECIFIED WITHOUT RESORTING TO THE E,
C     K  AND M NOTATIONS, THEN THE ROUTINE DAINXT SHOULD BE
C     USED INSTEAD OF DANEXT.  NUMBERS EVALUATED BY  DAINXT
C     MUST  CONSIST  ONLY  OF DIGITS FOLLOWING THE OPTIONAL
C     SIGN.  DAINXT TREATS THE CHARACTERS ., %, K AND M THE
C     SAME AS ANY OTHER DELIMITER CHARACTER.
C
C     FOLLOWING ARGUMENTS ARE USED FOR INPUT ONLY AND ARE
C     RETURNED UNCHANGED.
C
C     KONTRL = 1  OR  GREATER,  ITEM  IN  IBUFFR  ARRAY  IS
C              FLOATING  POINT.   IF POSSIBLE, THE FLOATING
C              POINT  NUMBER  WILL  BE  ACCUMULATED  AS  AN
C              INTEGER, THEN BE CONVERTED TO FLOATING POINT
C              AND SHIFTED IF NECESSARY.   KONTRL  IS  THEN
C              THE MAXIMUM NUMBER OF DIGITS IN THE INTEGER.
C              THE VALUE IS OUTPUT AS THE  ARGUMENT VALNEW.
C              IF  THE  ITEM  HAS  MORE THAN KONTRL DIGITS,
C              THEN  THE  ENTIRE  EVALUATION  IS  DONE   IN
C              FLOATING    POINT.     THE    ADVANTAGE   OF
C              CALCULATING THE  FLOATING  POINT  VALUES  IN
C              INTEGER  AS  LONG  AS  THE  PRECISION OF THE
C              COMPUTER  IS  NOT  OVERFLOWED  IS  THAT  THE
C              CALCULATION  OF  THE  PORTION  OF THE NUMBER
C              RIGHT OF THE DECIMAL POINT  IS  MORE  EXACT.
C              AS  AN EXAMPLE, IF KONTRL IS GREATER THAN OR
C              EQUAL TO 4, THEN THE  NUMBER  33.33  CAN  BE
C              STORED   AS   THE   INTEGER  3333,  THEN  BE
C              CONVERTED TO FLOATING POINT VALUE 3333.0 AND
C              DIVIDED   BY  100.0  TO  OBTAIN   THE  FINAL
C              ANSWER.  IF IT MAKES NO  DIFFERENCE  WHETHER
C              THE NUMBER TYPED AS 33.33 HAS VALUE 33.33 OR
C              33.32999...  THEN KONTRL CAN  BE  GIVEN  THE
C              VALUE 1.
C            = 0, ITEM IN IBUFFR ARRAY IS INTEGER  DECIMAL.
C              THE NUMBER CAN BE TYPED WITH A DECIMAL POINT
C              (FOR EXAMPLE 1.23K OR 1.23E3  EQUALS  1230),
C              BUT  IS  STORED AS AN INTEGER IN DAREAD, AND
C              IS OUTPUT  AS ARGUMENT NEWVAL.   ANY DECIMAL
C              INTEGER WHICH THE COMPUTER CAN REPRESENT CAN
C              BE  EVALUATED.    THIS  INCLUDES,   ON  TWOS
C              COMPLEMENT  COMPUTERS, THE  LARGEST NEGATIVE
C              NUMBER THE ABSOLUTE VALUE OF WHICH CANNOT BE
C              STORED.   ON THE  PDP10,  A 36 BIT  COMPUTER
C              WITH TWOS COMPLEMENT  NOTATION, THE RANGE OF
C              DECIMAL  INTEGERS  IS  -34359738368  THROUGH
C              34359738367  (OCTAL NOTATION OF BIT PATTERNS
C              BEING  400000000000  THROUGH  377777777777).
C            = -1, ITEM IN  IBUFFR  ARRAY  IS  OCTAL.   THE
C              NUMBER  CAN  BE  TYPED  WITH A DECIMAL POINT
C              AND/OR  WITH  AN  EXPONENT.   HOWEVER,   THE
C              NUMBER   FOLLOWING   THE  LETTER  E  OF  THE
C              EXPONENT IS EVALUATED IN DECIMAL.  THE VALUE
C              OF  THE  OCTAL  NUMBER  IS  RETURNED  AS THE
C              ARGUMENT  NEWVAL.   IT  MUST  BE NOTED  THAT
C              NUMBERS EVALUATED AS NEGATIVE OCTAL INTEGERS
C              HAVE THE  NEGATIVE  OCTAL  INTEGER  AS THEIR
C              VALUE,  NOT AS  THEIR BIT  REPRESENTATION IN
C              COMPUTER STORAGE.   FOR EXAMPLE, ON A 36 BIT
C              TWOS COMPLEMENT  COMPUTER,  THE OCTAL NUMBER
C              -400000000000 (WHICH COULD  ALSO BE TYPED AS
C              -4E11 OR -4E+11 WHERE  THE 11 AFTER THE E IS
C              IN DECIMAL)  IS REPRESENTED  AS BIT  PATTERN
C              HAVING OCTAL  NOTATION  400000000000 AND THE
C              OCTAL NUMBER -377777777777 IS REPRESENTED BY
C              THE BIT PATTERN 400000000001.
C     SLACK  = THE   FRACTION   OF   THE   INCREMENT,    IF
C              KONTRL.GT.0,  BY WHICH THE RETURNED VALUE OF
C              THE ARGUMENT  NAMED VALNEW  CAN  EXCEED  THE
C              UPPPER  BOUND  AND STILL BE CONSIDERED TO BE
C              WITHIN  THE  SERIES.   SLACK  IS   NECESSARY
C              BECAUSE  OF  THE IMPRECISION OF CALCULATIONS
C              INVOLVING REAL NUMBERS.  FOR EXAMPLE, IF THE
C              USER   WISHED   TO  HAVE  THE  INCREMENT  BE
C              0.666.... BETWEEN A LOWER BOUND OF  3.0  AND
C              AN   UPPER  BOUND  OF  5.0,  HE  MIGHT  TYPE
C              3/.667/5 AND EXPECT THAT THE NUMBERS  3.000,
C              3.667,  4.333,  AND  5.000 WOULD BE INCLUDED
C              WITHIN  THE  SERIES,  WHILE,  ACTUALLY,  THE
C              NUMBER  NEAR  5.00 WOULD BE CALCULATED TO BE
C              5.001 AND WOULD  THEREFORE  BE  OUTSIDE  THE
C              SERIES.   ALTHOUGH SLACK CAN BE SET TO ZERO,
C              A VALUE OF ABOUT 0.01  IS  RECOMMENDED.   IN
C              THE  ABOVE  EXAMPLE,  SLACK=0.01 WOULD CAUSE
C              THE ACTUAL UPPER BOUND TO BE 5.00667 SO THAT
C              THE  NUMBER  CALCULATED NEAR THE UPPER BOUND
C              WOULD BE INCLUDED WITHIN THE SERIES.   SLACK
C              SHOULD  ALMOST  CERTAINLY  NEVER  EXCEED 0.5
C              SINCE LARGER VALUES WOULD OFTEN LEAD TO  THE
C              INCLUSION  OF  VALUES NOT MEANT BY THE USER.
C              SLACK IS IGNORED IF KONTRL.LE.0.
C     IBUFFR = INPUT  BUFFER  ARRAY  CONTAINING  CHARACTERS
C              TYPED BY USER,  READ BY A  MULTIPLE OF AN A1
C              FORMAT,  WHICH IS TO BE SEARCHED  FOR SERIES
C              SPECIFICATIONS.   IBUFFR THEN  CONTAINS  ONE
C              CHARACTER PER COMPUTER STORAGE LOCATION.
C     MAXBFR = MAXIMUM SUBSCRIPT  OF  IBUFFR  ARRAY  TO  BE
C              SEARCHED
C
C     FOLLOWING ARGUMENTS ARE USED AS BOTH INPUT AND OUTPUT
C
C     LOWBFR = INPUT CONTAINING THE  SUBSCRIPT  WITHIN  THE
C              IBUFFR   ARRAY   OF   THE  FIRST  (LEFTMOST)
C              CHARACTER WHICH CAN BE SCANNED FOR A  SERIES
C              SPECIFICATION.  LOWBFR IS RETURNED UNCHANGED
C              IF  THIS  CALL  TO   THIS   ROUTINE   MERELY
C              GENERATES  THE NEXT MEMBER OF A SERIES BEGUN
C              BY  A  PREVIOUS  CALL.   IF  A  NEW   SERIES
C              SPECIFICATION  IS  EVALUATED BY THIS CALL TO
C              THIS ROUTINE, THEN LOWBFR WILL  BE  RETURNED
C              POINTING  TO  THE  NEXT CHARACTER BEYOND THE
C              SERIES SPECIFICATION.  IF  A  SECOND  NUMBER
C              IMMEDIATELY   FOLLOWS   A  FIRST  WITHOUT  A
C              SEPARATING SLASH OR  ASTERISK,  THEN  LOWBFR
C              WILL  BE  RETURNED  POINTING  TO  THE  FIRST
C              CHARACTER OF THE SECOND NUMBER.  IF EITHER A
C              SPACE  OR  A  TAB CHARACTER FOLLOWS A SERIES
C              SPECIFICATION, THEN LOWBFR WILL BE  RETURNED
C              POINTING  TO THE SPACE OR TAB CHARACTER.  IF
C              THERE IS NOTHING AT OR TO RIGHT  OF  LOWBFR,
C              THEN   LOWBFR   WILL  BE  LEFT  POINTING  AT
C              MAXBFR+1   AND   KIND   WILL   BE   RETURNED
C              CONTAINING ONE.  LOWBFR AND MANY MUST BE SET
C              BY THE CALLING PROGRAM  BEFORE  ANYTHING  IS
C              PROCESSED  IN  THE  CURRENT  CONTENTS OF THE
C              IBUFFR  ARRAY,  BUT  THEN  SHOULD   NOT   BE
C              MODIFIED  BY  THE  CALLING PROGRAM UNTIL THE
C              ENTIRE CONTENTS OF THE IBUFFR ARRAY HAS BEEN
C              PROCESSED.
C     MANY   = SHOULD BE INPUT CONTAINING  ZERO  EACH  TIME
C              THIS  ROUTINE  IS CALLED TO BEGIN PROCESSING
C              OF A NEW LOGICAL SECTION  OF  TEXT,  AS  FOR
C              EXAMPLE  WHEN BEGINNING PROCESSING OF A LINE
C              OF TEXT NOT TIED TO THE PREVIOUS LINE BY  AN
C              AMPERSAND  AT  THE END OF THE PREVIOUS LINE,
C              OR WHEN PROCESSING THE TEXT TO THE RIGHT  OF
C              A  SEMICOLON.   MANY IS RETURNED SET TO ZERO
C              WHENEVER AN  END OF LINE  (KIND=1)  IS FOUND
C              WHICH IS NOT  TIED TO THE  FOLLOWING LINE BY
C              AN AMPERSAND,  AND  WHENEVER  A SEMICOLON IS
C              FOUND (KIND=2). MANY IS RETURNED INCREMENTED
C              BY 1 EACH TIME A NEW SPECIFICATION OF EITHER
C              A  SINGLE  NUMBER  OR  OF A SERIES IS FOUND,
C              EACH TIME AN ERRONEOUS SERIES  SPECIFICATION
C              IS  FOUND,  OR  EACH TIME AN INDICATION OF A
C              MISSING SERIES SPECIFICATION IS FOUND.  MANY
C              IS  RETURNED  UNCHANGED IF THIS CALL TO THIS
C              ROUTINE MERELY GENERATES THE NEXT MEMBER  OF
C              A SERIES ALREADY BEGUN BY A PREVIOUS CALL TO
C              THIS ROUTINE.  KIND IS  RETURNED  CONTAINING
C              THE  VALUE 3 AND MANY IS RETURNED CONTAINING
C              THE NEGATIVE OF THE NUMBER OF ITEMS FOUND IF
C              THE  NEXT  PRINTING  CHARACTER  FOLLOWING  A
C              COMMA IS AN AMPERSAND.  MANY SHOULD  NOT  BE
C              CHANGED   BY   THE  CALLING  PROGRAM  IF  AN
C              AMPERSAND (KIND BEING RETURNED=3)  IS  FOUND
C              INDICATING  THAT THE SUBSEQUENT CALL TO THIS
C              ROUTINE IS TO PROCESS TEXT WHICH  IS  TO  BE
C              TREATED  AS  THOUGH  IT APPEARED IN PLACE OF
C              THE AMPERSAND  AND  THE  CHARACTERS  TO  ITS
C              RIGHT.   THE EFFECT IS NOT QUITE THE SAME AS
C              IF THE USER HAD TYPED ALL OF THE TEXT  ON  A
C              SINGLE    LINE   SINCE   A   SINGLE   SERIES
C              SPECIFICATION CANNOT  BE  SPLIT  ACROSS  THE
C              LINE BOUNDARY.
C
C              IF MANY IS INPUT CONTAINING  ZERO,  THEN  AN
C              INITIAL  COMMA  IN  THE INPUT TEXT BUFFER IS
C              TAKEN TO INDICATE AN INITIAL  MISSING  ITEM,
C              AND  MANY IS THEN RETURNED CONTAINING 1.  IF
C              MANY IS INPUT GREATER  THAN  ZERO,  THEN  AN
C              INITIAL  COMMA  IS  IGNORED IF FOLLOWED BY A
C              SERIES  SPECIFICATION.   IF  MANY  IS  INPUT
C              GREATER  THAN  ZERO,  THEN  AN INITIAL COMMA
C              FOLLOWED BY NO OTHER PRINTING CHARACTERS, BY
C              A  SEMICOLON,  OR  BY  AN  EXCLAMATION POINT
C              INDICATES A MISSING ITEM.  IF MANY IS  INPUT
C              GREATER  THAN  ZERO,  THEN  AN INITIAL COMMA
C              FOLLOWED BY  AN  AMPERSAND  WILL  CAUSE  THE
C              REMAINING  CHARACTERS  IN  THE  BUFFER TO BE
C              IGNORED,   AND   MANY   WILL   BE   RETURNED
C              CONTAINING  THE NEGATIVE OF ITS INPUT VALUE.
C              IF  MANY  IS  INPUT  NEGATIVE,  THEN  IT  IS
C              ASSUMED  THAT  THE  CONTENTS  OF THE CURRENT
C              BUFFER  CONTINUE  A  PREVIOUS   LINE   WHICH
C              TERMINATED  WITH  A  COMMA  FOLLOWED  BY  AN
C              AMPERSAND, AND MANY IS RETURNED GREATER THAN
C              ZERO.
C     KIND   = SHOULD BE  INPUT  CONTAINING  ZERO THE FIRST
C              TIME THIS  ROUTINE IS CALLED,  OR TO ABANDON
C              GENERATATION  OF VALUES WITHIN  A PARTICULAR
C              SERIES.   KIND  IS  RETURNED  DESCRIBING THE
C              KIND OF ITEM LOCATED IN THE IBUFFR ARRAY.
C            = 1, NOTHING, EXCEPT PERHAPS COMMENT INDICATED
C              BY A LEADING EXCLAMATION POINT, WAS FOUND AT
C              OR TO RIGHT OF LOWBFR.   THE CALLING PROGRAM
C              SHOULD READ A NEW LINE INTO IBUFFR.  MANY IS
C              RETURNED SET TO ZERO.
C            = 2,  A  SEMICOLON  WAS  FOUND  AS  THE  FIRST
C              PRINTING  CHARACTER  AT  OR  TO THE RIGHT OF
C              LOWBFR.  LOWBFR IS RETURNED POINTING TO  THE
C              NEXT  CHARACTER  BEYOND  THE LOCATION OF THE
C              SEMICOLON.   IT  IS  ASSUMED   THE   CALLING
C              PROGRAM  WILL  TREAT  THE  APPEARANCE OF THE
C              SEMICOLON AS MARKING THE END OF A STATEMENT.
C              MANY IS RETURNED SET TO ZERO.
C            = 3, AN  AMPERSAND  WAS  FOUND  AS  THE  FIRST
C              PRINTING  CHARACTER  AT  OR  TO THE RIGHT OF
C              LOWBFR.   THE  TEXT  TO  THE  RIGHT  OF  THE
C              AMPERSAND IS TAKEN AS A COMMENT SO LOWBFR IS
C              RETURNED POINTING BEYOND THE  RIGHT  END  OF
C              THE  BUFFER.  IT IS ASSUMED THAT THE CALLING
C              PROGRAM WILL READ IN THE CONTENTS OF  A  NEW
C              BUFFER,  THEN  AGAIN  REQUEST  A  NEW SERIES
C              EVALUATION FROM THIS ROUTINE.   THE VALUE OF
C              MANY MUST NOT BE CHANGED BY  CALLING PROGRAM
C              PRIOR TO THIS FOLLOWING CALL.  THE EFFECT IS
C              NOT  QUITE THE SAME AS IF THE USER HAD TYPED
C              ALL OF THE TEXT ON A  SINGLE  LINE  SINCE  A
C              SERIES  SPECIFICATION CANNOT BE SPLIT ACROSS
C              A LINE BOUNDARY.
C            = 4, A NUMBER OR SERIES SPECIFICATION WAS  NOT
C              FOUND,  BUT  A COMMA  WAS  FOUND  INDICATING
C              A  MISSING  SERIES  SPECIFICATION.    EITHER
C              NEWVAL OR VALNEW IS RETURNED  CONTAINING THE
C              VALUE  ZERO  SO  KIND=4  CAN  BE  CONSIDERED
C              EQUIVALENT TO KIND=5  IF SUCH IS APPROPRIATE
C              TO THE APPLICATION FOR WHICH THIS ROUTINE IS
C              BEING USED.
C            = 5, THE NEXT NUMBER SPECIFIED BY THE CONTENTS
C              OF THE INPUT BUFFER IS BEING RETURNED AS THE
C              VALUE  OF  THE  ARGUMENT  NEWVAL OR  VALNEW.
C            = 6,  A  SERIES  WAS   SPECIFIED  IN  ASTERISK
C              NOTATION, BUT NO NUMBER APPEARED TO RIGHT OF
C              THE ASTERISK. VALNEW OR NEWVAL, WHICHEVER IS
C              APPROPRIATE,  IS  RETURNED WITH  VALUE ZERO.
C              NOTE THAT  IF A NUMBER DOES  NOT PRECEDE THE
C              ASTERISK,  THEN  KIND IS  RETURNED  WITH THE
C              VALUE 7 WHETHER OR  NOT A NUMBER FOLLOWS THE
C              ASTERISK.
C            = 7,  A  SERIES  WAS  SPECIFIED  IN   ASTERISK
C              NOTATION, BUT NO NUMBER APPEARED TO THE LEFT
C              OF THE ASTERISK OR THE NUMBER TO LEFT OF THE
C              ASTERISK WAS LESS  THAN 1  (OR LESS THAN 0.5
C              IF EVALUATED AS A REAL NUMBER AS THIS NUMBER
C              IS ROUNDED WHEN USED).   A NUMBER MAY OR MAY
C              NOT HAVE APPEARED TO RIGHT OF THE ASTERISK.
C            = 8, A SERIES SPECIFICATION  WAS  FOUND  WHICH
C              CONTAINED   TOO   MANY   NUMBERS,  TOO  MANY
C              ASTERISKS OR TOO  MANY  SLASHES.
C            = 9, FIRST PRINTING CHARACTER IN OR  TO  RIGHT
C              OF  LOWBFR  WAS  NOT A CHARACTER WHICH COULD
C              APPEAR IN A NUMBER OR NUMBER RANGE, AND  WAS
C              NOT A COMMA, SEMICOLON OR EXCLAMATION POINT.
C              LOWBFR  IS  RETURNED  POINTING  TO  THE NEXT
C              CHARACTER BEYOND THIS CHARACTER.
C
C     FOLLOWING ARGUMENTS ARE USED ONLY FOR OUTPUT
C
C     NEWVAL = RETURNED CONTAINING NEW VALUE IF KONTRL.LE.0
C              AND KIND RETURNED =5.
C     VALNEW = RETURNED CONTAINING NEW VALUE IF KONTRL.GT.0
C              AND KIND RETURNED =5.
C
C     INCVAL, LMTVAL, VALINC AND  VALLMT  MUST BE PRESERVED
C     FROM ONE CALL TO NEXT BUT NOT USED BY CALLING PROGRAM
C
      DIMENSION IBUFFR(MAXBFR)
C
      IF(KIND.EQ.6)GO TO 4
      IF(KIND.NE.5)GO TO 6
      IF(INCVAL.EQ.0)GO TO 4
C
C     GET NEXT NUMBER EXPRESSED IN SLASH NOTATION
      IF(KONTRL.GT.0)GO TO 2
      NEWVAL=NEWVAL+INCVAL
      IF(INCVAL.GT.0)GO TO 1
      IF(NEWVAL.GE.LMTVAL)GO TO 22
      GO TO 6
    1 IF(NEWVAL.LE.LMTVAL)GO TO 22
      GO TO 6
    2 VALOLD=VALNEW
      VALNEW=VALNEW+VALINC
      IF(VALINC.GT.0.0)GO TO 3
      IF(VALNEW.GE.VALOLD)GO TO 6
      IF(VALNEW.GE.(VALLMT+(SLACK*VALINC)))GO TO 22
      GO TO 6
    3 IF(VALNEW.LE.VALOLD)GO TO 6
      IF(VALNEW.LE.(VALLMT+(SLACK*VALINC)))GO TO 22
      GO TO 6
C
C     GET NEXT NUMBER EXPRESSED IN ASTERISK NOTATION
    4 IF(KONTRL.GT.0)GO TO 5
      LMTVAL=LMTVAL-1
      IF(LMTVAL.GT.0)GO TO 22
      GO TO 6
    5 VALLMT=VALLMT-1.0
      IF(VALLMT.GT.0.5)GO TO 22
C
C     GET NEW RANGE SPECIFICATION
    6 CALL DASPAN(KONTRL,-1,IBUFFR,MAXBFR,LOWBFR,
     1MANY,KIND,INIGOT,INCGOT,LMTGOT,NEWVAL,INCVAL,
     2LMTVAL,VALNEW,VALINC,VALLMT)
      GO TO(9,9,9,9,7,7,13,19,8,8),KIND
C
C     SINGLE NUMBER WITHOUT SLASH OR ASTERISK
    7 IF(KONTRL.GT.0)GO TO 12
      GO TO 10
    8 KIND=KIND-1
    9 IF(KONTRL.GT.0)GO TO 11
      NEWVAL=0
   10 LMTVAL=0
      GO TO 21
   11 VALNEW=0.0
   12 VALINC=0.0
      VALLMT=0.0
      GO TO 21
C
C     SERIES CONTAINING SLASH
   13 KIND=5
      IF(KONTRL.GT.0)GO TO 16
      IF(INIGOT.LE.0)NEWVAL=0
      IF(INCGOT.LE.0)INCVAL=1
      IF(INCVAL.EQ.0)INCVAL=1
      IF(LMTGOT.LE.0)LMTVAL=0
      IF(NEWVAL.GT.LMTVAL)GO TO 14
      IF(INCVAL.GT.0)GO TO 22
      GO TO 15
   14 IF(INCVAL.LT.0)GO TO 22
   15 INCVAL=-INCVAL
      GO TO 22
   16 INCVAL=1
      IF(INIGOT.LE.0)VALNEW=0.0
      IF(INCGOT.LE.0)VALINC=1.0
      IF(VALINC.EQ.0)VALINC=1.0
      IF(LMTGOT.LE.0)VALLMT=0.0
      IF(VALNEW.GT.VALLMT)GO TO 17
      IF(VALINC.GT.0)GO TO 22
      GO TO 18
   17 IF(VALINC.LT.0)GO TO 22
   18 VALINC=-VALINC
      GO TO 22
C
C     SERIES CONTAINING ASTERISK
   19 KIND=5
      IF(LMTGOT.LE.0)KIND=6
      IF(KONTRL.GT.0)GO TO 20
      IF(INIGOT.LE.0)NEWVAL=0
      IF(LMTGOT.LE.0)LMTVAL=0
      IF(NEWVAL.LE.0)KIND=7
      INCVAL=NEWVAL
      NEWVAL=LMTVAL
      LMTVAL=INCVAL
      GO TO 21
   20 IF(INIGOT.LE.0)VALNEW=0.0
      IF(LMTGOT.LE.0)VALLMT=0.0
      IF(VALNEW.LE.0.5)KIND=7
      VALINC=VALNEW
      VALNEW=VALLMT
      VALLMT=VALINC
      VALINC=0.0
   21 INCVAL=0
C
C     RETURN TO CALLING PROGRAM
   22 RETURN
C602332267874
      END