Institut für Astronomie und AstrophysikAbteilung AstronomieSand 1, D-72076 Tübingen, GermanyNew Address! -- Neue Adresse! |
VALID_NUM
Check if a string is a valid number representation.
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.
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
[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]