CONVERT_TO_TYPE
Converts its input argument to a specified data type.
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
Utilities
result = Convert_To_Type(input, type)
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.
result: The input data is converted to specified data type.
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.
Data types STRUCT, POINTER, and OBJREF are not allowed.
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.