Index Page
cspice_lparse
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 

Abstract
I/O
Examples
Particulars
Required Reading
Version
Index_Entries

Abstract


   CSPICE_LPARSE parses from a string, a list of items
   delimited by a single character.

   For important details concerning this module's function, please refer to
   the CSPICE routine lparse_c.

I/O

   
   Given:
   
       list      a string containing a list of items delimited
                 by the character 'delim'
       delim     the character used to delimit items in the
                 string 'list'
       n _max    the maximum number of separate items
                 extracted from 'list' to return
   
   the call:
   
      cspice_lparse, list, delim, n_max, items
   
   returns:
   
      items   a string array containing up-to 'n_max' entries
              where each array element represents one item from 
             'list'
   
   Note: 'items' returns with size of n_max or less.
   
   IDL native code to perform the same operation:
   
      items = strsplit ( list, delim, /EXTRACT )
   

Examples


   Any numerical results shown for this example may differ between
   platforms as the results depend on the SPICE kernels used as input
   and the machine specific arithmetic implementation.

   
      ;;
      ;; Define the parameters and list of delimited items.
      ;;
      ;; Think of a sentence as a list delimited by a space.
      ;; DELIM is assigned to a space.
      ;;
      N_MAX = 25
      LIST  = 'Run and find out.'
      DELIM = ' '
   
      ;;
      ;; Parse the items from LIST.
      ;;
      cspice_lparse, list, DELIM, N_MAX, items
   
      ;;
      ;; Output our list.
      ;;
      items_size = size( items, /dimension )
   
      for i = 0, (items_size[0] -1 ) do begin
         print, 'Item ' + string(i) + ' : ' + items[i]
      endfor
   
   IDL outputs:
   
      Item        0 : Run
      Item        1 : and
      Item        2 : find
      Item        3 : out.

Particulars


   None.

Required Reading


   ICY.REQ

Version


   -Icy Version 1.0.0, 16-JUN-2003, EDW (JPL)

Index_Entries

 
   parse items from a list 
 



Wed Apr  5 17:58:02 2017