[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Sand 1, D-72076 Tübingen, Germany
New Address!   --   Neue Adresse!
[Uni logo]


VALID_NUM Source code in valid_num.pro

VALID_NUM

Name
     VALID_NUM
Purpose
     Check if a string is a valid number representation.
Explanation
     The input string is parsed for characters that may possibly
     form a valid number.  It is more robust than simply checking
     for an IDL conversion error because that allows strings such
     as '22.3qwert' to be returned as the valid number 22.3
     See also the original NUM_CHK which returns the status in
     the opposite sense.
Calling Sequence
     IDL> status = valid_num(string  [,value]  [,/integer])
 Inputs      : string  -  the string to be tested
 Opt. Inputs : None
 Outputs     : The function returns 1 for valid, 0 for invalid number
 Opt. Outputs: value   - The value the string decodes to.  This will be
                         returned as a double precision number unless /INTEGER
                         is present, in which case a long integer is returned.
 Keywords    : Integer   -  if present code checks specifically for an integer.
 Calls       : None
 Restrictions: None
 Category    : Utilities, Numerical
 Prev. Hist. : Small changes from NUM_CHK by Andrew Bowen,
                                             Tessella Support Services, 8/3/93
 Written     : CDS version by C D Pike, RAL, 24-May-93
 Modified    : Version 1, C D Pike, RAL, 24-May-93
               Version 2, William Thompson, GSFC, 14 October 1994
                       Added optional output parameter VALUE to allow
                       VALID_NUM to replace STRNUMBER in FITS routines.
 Version     : Version 1  24-May-93
       Converted to IDL V5.0   W. Landsman   September 1997

Last modified by pro2html on 2002 April 26 at 03:51 UTC

[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]

Jörn Wilms (wilms@astro.uni-tuebingen.de)
Updated automatically