Previous: utidr Up: ../plot79_u.html Next: utifa


UTIDT

       SUBROUTINE  UTIDT (TEXT,LENTXT,NEXT,ERROR,FIELD,LENGTH,QUOTE,
      X                   FLUSH)
 C$    (Decode Character String)
 C$    Convert  a  character  string  delimited  by  a   specified
 C$    character to a string  stored 1 character/word in  TEXT(*).
 C$    To permit  free-form input,  the conversion  will  continue
 C$    until the terminal delimiter is  found, or else the end  of
 C$    FIELD(*) is reached.
 C$
 C$    If the delimiter is non-blank, then if it is present in the
 C$    string,  it   must  be   represented  by   two   successive
 C$    delimiters.  For example, 'O''Neill' will become O'Neill.
 C$
 C$    If the delimiter character is a  blank, then it may not  be
 C$    present in the string  to be returned,  because a blank  is
 C$    also considered a data  item separator.  A blank  delimiter
 C$    is useful, for  example, in  extracting words  from a  text
 C$    file.  The string will implicitly be extended on both  ends
 C$    by a blank character, so that  the user need not bother  to
 C$    ensure this in  order to correctly  retrieve the first  and
 C$    last words  in a  string from  which leading  and  trailing
 C$    blanks have been trimmed.
 C$
 C$    A pointer  is  set to  the  next unprocessed  character  in
 C$    FIELD(*) (which  might  be  FIELD(LENGTH+1))  so  that  the
 C$    caller may check for valid syntax.  The arguments are:
 C$
 C$    TEXT(*)........Character string (returned).
 C$    LENTXT.........Number of characters in TEXT(*).   It may be
 C$                   zero.
 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.  NUMBER
 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$    QUOTE..........Delimiter character (A1 format).  It may be
 C$                   any valid Hollerith character.
 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 strings  separated by  commas, spaces,  etc.   The
 C$    caller  must  realize,  however,  that  this  might   cause
 C$    skipping     over     incorrectly-coded     items     (e.g.
 C$    '1',"2",'3','4','5' for '1','2','3','4','5').
 C$    (08-APR-82)