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

Table of contents
Abstract
I/O
Parameters
Examples
Particulars
Exceptions
Files
Restrictions
Required_Reading
Literature_References
Author_and_Institution
Version
Index_Entries


Abstract


   CSPICE_ISWHSP returns a boolean indicating whether an input string contains
   only whitespace characters (true) or not (false).

I/O


   Given:

      string   a string to be searched for non-white-space characters.

               help, string
                  STRING = Scalar

   the call:

      iswhsp = cspice_iswhsp( string )

   returns:

      iswhsp   the boolean value true if the string contains only white space
               characters; otherwise it returns the value false.

               help, iswhsp
                  BOOLEAN = Scalar

               White space characters are those in the set

                  { ' ', '\f', '\n', '\r', '\t', '\v' }

Parameters


   None.

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.

   1) Check, for different input character strings, if they contain
      only whitespace characters.

      Example code begins here.


      PRO iswhsp_ex1

         ;;
         ;; A single space signals the whitespace flag...
         ;;
         print, 'Single space: '
         if ( cspice_iswhsp( ' ' ) ) then print, '   Whitespace' $
         else print, '   Not whitespace.'

         ;;
         ;; ...but a non-whitespace character in a string with a
         ;; whitespace does not.
         ;;
         print, 'A non-whitespace character in string with whitespaces: '
         if ( cspice_iswhsp( ' x' ) ) then print, '   Whitespace' $
         else print, '   Not whitespace.'

         ;;
         ;; A combination of whitespace and non-whitespace.
         ;;
         print, 'Combination of whitespace and non-whitespace: '
         if ( cspice_iswhsp( ' a b c ' ) ) then print, '   Whitespace' $
         else print, '   Not whitespace.'

         ;;
         ;; Multiple space characters signals the whitespace flag...
         ;;
         print, 'Multiple space characters: '
         if ( cspice_iswhsp( '     ' ) ) then print, '   Whitespace' $
         else print, '   Not whitespace.'

         ;;
         ;; ...as does an empty string.
         ;;
         print, 'Empty string: '
         if ( cspice_iswhsp( '' ) ) then print, '   Whitespace' $
         else print, '   Not whitespace.'

      END


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, the output was:


      Single space:
         Whitespace
      A non-whitespace character in string with whitespaces:
         Not whitespace.
      Combination of whitespace and non-whitespace:
         Not whitespace.
      Multiple space characters:
         Whitespace
      Empty string:
         Whitespace


      Note: the Icy interface does not pass escaped whitespace
      markers \t, \f, \r, \n, \v as whitespace. cspice_iswhsp
      signals these string markers as non-whitespace.

Particulars


   This routine provides a short cut for testing lines for the presence
   of non-blank characters; this is a test which is performed frequently
   in Icy.

Exceptions


   1)  An empty string is considered to be blank.

   2)  If the input argument `string' is undefined, an error is
       signaled by the IDL error handling system.

   3)  If the input argument `string' is not of the expected type, or
       it does not have the expected dimensions and size, an error is
       signaled by the Icy interface.

Files


   None.

Restrictions


   None.

Required_Reading


   ICY.REQ

Literature_References


   None.

Author_and_Institution


   J. Diaz del Rio     (ODC Space)
   E.D. Wright         (JPL)

Version


   -Icy Version 1.0.1, 10-AUG-2021 (JDR)

       Edited the header to comply with NAIF standard. Added example's
       problem statement, and reformatted example's output.

       Added -Parameters, -Exceptions, -Files, -Restrictions,
       -Literature_References and -Author_and_Institution sections, and
       completed -Particulars section.

       Edited the -I/O section to comply with NAIF standard.

       Removed reference to the routine's corresponding CSPICE header from
       -Abstract section.

       Added arguments' type and size information in the -I/O section.

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

Index_Entries


   read a non-blank line from a text file



Fri Dec 31 18:43:05 2021