CONVERT_TO_TYPE Name
CONVERT_TO_TYPE
Purpose
Converts its input argument to a specified data type.
Author
FANNING SOFTWARE CONSULTING
David Fanning, Ph.D.
1645 Sheely Drive
Fort Collins, CO 80526 USA
Phone: 970-221-0438
E-mail: david@idlcoyote.com
Coyote's Guide to IDL Programming: http://www.idlcoyote.com
Category
Utilities Calling Sequence
result = Convert_To_Type(input, type)
Input Parameters
input: The input data to be converted.
type: The data type. Accepts values as given by Size(var, /TNAME) or Size(var, /TYPE).
If converting to integer types, values are truncated (similar to FLOOR keyword below),
unless keywords are set.
Output Parameters
result: The input data is converted to specified data type.
Keywords
CEILING: If set and converting to an integer type, the CEIL function is applied before conversion.
FLOOR: If set and converting to an integer type, the FLOOR function is applied before conversion.
ROUND: If set and converting to an integer type, the ROUND function is applied before conversion.
Restrictions
Data types STRUCT, POINTER, and OBJREF are not allowed.
Modification History
Written by David W. Fanning, 19 February 2006.
Typo had "UNIT" instead of "UINT". 23 February 2009. DWF.
Added CEILING, FLOOR, and ROUND keywords. 1 April 2009. DWF.
Modified so that the "type" variable is not changed by the program. 5 May 2009. DWF.