PRO str2londbl, str, value, type, status
; Description: This module will convert the string parameter "str" to a number "value" of
; either LONG or DOUBLE type. If "str" is a string that represents a number,
; consists only of characters from the set "+-0123456789", and has a value
; x that lies in the range (-2^31) <= x <= (2^31 - 1), then the module will
; convert "str" to a number "value" of LONG type. If "str" is a string that
; represents a number but includes a character that is not from the set
; "+-0123456789", or it has a value x that lies outside of the range
; (-2^31) <= x <= (2^31 - 1), then the module will convert "str" to a number
; "value" of DOUBLE type. If "str" is a string that does not represent a valid
; number, then the module will fail.
;
; Input Parameters:
;
; str - STRING - The string to be converted to a number of LONG or DOUBLE type.
;
; Output Parameters:
;
; value - LONG/DOUBLE - The value of the converted string "str" as a number of LONG or
; DOUBLE type.
; type - INTEGER - If "str" is a string that represents a number, consists only of
; characters from the set "+-0123456789", and has a value x that lies
; in the range (-2^31) <= x <= (2^31 - 1), then the module will convert
; "str" to a number "value" of LONG type, and the parameter "type" will
; be set to "3". If "str" is a string that represents a number but includes
; a character that is not from the set "+-0123456789", or it has a value
; x that lies outside of the range (-2^31) <= x <= (2^31 - 1), then the
; module will convert "str" to a number "value" of DOUBLE type, and the
; parameter "type" will be set to "5". If the module fails in any way,
; then the parameter "type" will be set to "0".
; status - INTEGER - If the module successfully converted "str" to a number "value" of
; either LONG or DOUBLE type, then "status" is returned with a value
; of "1", otherwise it is returned with a value of "0".
;
; Author: Dan Bramich (dan.bramich@hotmail.co.uk)
;
; History:
;
; 18/02/2010 - Module created (dmb).
;Set the default output parameter values
;Check that "str" is a scalar string that represents a number
;Decompose "str" into individual characters
;Determine if "str" consists only of the characters "+-0123456789" or not
;Set "status" to "1"
;If "str" contains characters other than those in the set "+-0123456789", then return the
;corresponding number "value" as a number of DOUBLE type
;If "str" has a value x that lies outside the range (-2^31) <= x <= (2^31 - 1), then return
;the corresponding number "value" as a number of DOUBLE type
;By reaching this point, "str" may be converted safely to a number of LONG type