>  Docs Center  >  Libraries  >  JHU/APL/S1R  >  TXTGETKEY






      Get a keyword value from a string array.


Calling Sequence

      val = txtgetkey(key)


      key = keyword to find. Case ignored. in

Keyword Parameters


        INIT=txtarr string array to search. Must be given as an
          initialization array before asking for values. If txtarr
          stays the same it need be given only on first call.
        DELIMITER=del Set keyword/value delimiter (def is =).
        /LIST lists keywords and values.
        /STRUCTURE return all keywords and values in a structure.
          Repeated keywords returned as an array in structure
          with the elements the same order as in the input.
          Can check returned structure for a tag using tag_test().
          Beware that IDL reserved words if used as keywords
          will cause an error (not allowed as structure tags).
        TYPE=typ Use with /STRUCTURE to convert values to a data
          type other than the default string. Must give an array
          of type codes (as returned by the size function), one for
          each item in the returned structure and in the same
          order. Repeated items are returned as an array, the
          array counts as one item in the structure so give only
          one type code for the array.
        /NOSORT The tag is obsolete and not used or needed. It was
          used with /STRUCTURE and may be dropped in the future.
        /START start search at beginning of array, else
          continue from last position (can pick up multiple
          copies of a keyword by not using /START).
        INDEX=indx Index where key was found.


      val = returned value of keyword. out
        See notes below. Null string if key not found.

Common Blocks



      Notes: File must contain keywords and values separated by an
        equal sign (=) or DELIM. When a matching keyword is found
        everything following the equal is returned as a text
        string. Spaces are optional. Some examples:
          title = This is a test.
          xrange = 10, 20
        Example call: v = txtgetkey(init=txt, key).
        Comment lines have * as first non-blank character.
        Comment lines and blank lines are ignored so may be used.

Modification History

      R. Sterner, 17 Mar, 1993
      R. Sterner, 25 Oct, 1993 --- Added DELIMITER keyword.
      R. Sterner, 1994 May 6 --- Added /START and fixed minor bugs.
      R. Sterner, 1995 Jun 26 --- Added INDEX keyword.
      R. Sterner, 2001 May 23 --- Added /STRUCTURE keyword.
      R. Sterner, 2002 Jul 01 --- Allowed repeated keywords with structure.
      R. Sterner, 2003 May 22 --- Minor cleanup, help text.
      R. Sterner, 2003 May 22 --- Allowed comment char after 1st col.
      R. Sterner, 2004 Mar 25 --- Added /NOSORT keyword.
      R. Sterner, 2005 Sep 07 --- Added comment on IDL reserved words.
      R. Sterner, 2006 Sep 06 --- Allowed an optional type code array.
      R. Sterner, 2006 Sep 24 --- Used typ[]instead of typ().
      R. Sterner, 2010 May 04 --- Converted arrays from () to [].
      R. Sterner, 2011 Sep 14 --- Rewrote structure section using tag_add,
      array elements are now returned in correct order.
  Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory
  This software may be used, copied, or redistributed as long as it is not
  sold and this copyright notice is reproduced on each copy made. This
  routine is provided as is without any express or implied warranties
  whatsoever. Other limitations apply as described in the file disclaimer.txt.

© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us