Previous: utida Up: ../plot79_u.html Next: utidi
SUBROUTINE UTIDF (VALUE,NEXT,ERROR,FIELD,LENGTH,NBASE,FLUSH)
C$ (Decode Floating-Point from Character Form)
C$ Convert a floating-point value represented as a string of
C$ digits in FIELD(*) to internal (binary) format. Leading
C$ blanks and tabs are ignored. Unlike FORTRAN formatted
C$ input, blanks are significant. To permit free-form input,
C$ the conversion will continue until a character which is not
C$ a sign, valid digit, decimal point, or exponent is found,
C$ or else the end of FIELD(*) is reached. A pointer is set
C$ to the next unprocessed character in FIELD(*) (which might
C$ be FIELD(LENGTH+1)) so that the caller may check for valid
C$ syntax. The conversion is carried out in DOUBLE PRECISION,
C$ and the character string may be written as an INTEGER, a
C$ REAL, or a DOUBLE-PRECISION value, with or without an
C$ exponent. That is, any of the following forms are
C$ acceptable:
C$
C$ sn sn. s.n sn.n snexp sn.exp s.nexp sn.nexp
C$
C$ where exp is an exponent of the form
C$
C$ Esn Dsn Qsn +n -n
C$
C$ In these, n is a string of one or more digits, s is an
C$ optional sign, and E, D, or Q may be used to flag the
C$ exponent. Q should be used in the unlikely event that a
C$ base larger than 10 is specified, or else the exponent
C$ letter should be omitted. Lower-case letters for the
C$ exponent designator, or for digits when the base is larger
C$ than 10 are acceptable. The arguments are:
C$
C$ VALUE.........DOUBLE PRECISION value (returned).
C$ NEXT..........On exit, index of the character in FIELD(*)
C$ which follows the last character processed.
C$ On input, it should point to the first
C$ character to be processed.
C$ ERROR......... .TRUE. - No valid characters found. VALUE
C$ is set to 0.
C$ .FALSE. - No error occurred.
C$ FIELD(*)......Character string to be decoded (A1 format).
C$ LENGTH........Number of characters in FIELD(*).
C$ NBASE.........Number base. If not in the range (2,16), the
C$ nearest of 2 or 16 will be assumed.
C$ FLUSH......... .TRUE. - Flush any leading invalid
C$ characters.
C$ .FALSE. - Do not flush leading invalid
C$ characters.
C$
C$ The FLUSH option is useful to allow successive calls to
C$ retrieve values separated by commas, spaces, etc. The
C$ caller must realize, however, that this might cause
C$ skipping over incorrectly-coded items (e.g. "1,2,3,R,5" for
C$ "1,2,3,4,5").
C$ (11-SEP-85)