%N getfield %F $MIR/src/subs/string.for
%D Extract a field from a string.
%P rjs
%: strings
%B
      subroutine getfield(string,k1,k2,token,length)

      integer k1,k2,length
      character string*(*),token*(*)
  ---------------------------------------------------------------------
  Extract a "field".  This looks for a separator, which may be a comma
  or white character.  It also worries about bracketing with ()
  characters and strings enclosed within quotes.

  Input:
    string     The string containing the fields.
  Input/Output:
    k1,k2      These delimit the characters in the string that are
               to be processed. On output, k1 is incremented to point
               beyond the token just returned.
  Output:
    token      The returned token.
    length     The length of the token.
