NAME: badpar PURPOSE: (one line) Validate an input parameter against valid entries. DESCRIPTION: This is a general parameter checking function for validating input quantities in other procedures and functions. This routine will generate an error message indicating what is wrong with the item. Example of use: pro foo,array if badpar(array,[4,5],2,CALLER='foo') then return . . code for foo . . end This would cause an immediate return to the routine that called foo with an error message if the input was not either floating or double and 2 dimensional. As of IDL v3.0, these are the recognized type codes (see 1-218 in reference guide). Type Code Data Type ---- ----------------------------- 0 Undefined 1 Byte 2 Integer 3 Longword integer 4 Floating point 5 Double-precision floating 6 Complex floating 7 String 8 Structure 9 Double-precision complex 10 Pointer 11 Object reference 12 Unsigned integer 13 Unsigned Longword integer 14 64-bit integer 15 Unsigned 64-bit integer CATEGORY: Utility CALLING SEQUENCE: val = badpar(param,goodtype,goodrank) INPUTS: param - IDL variable to validate. goodtype - Scalar or vector of type codes that are valid. goodrank - Scalar or vector of valid ranks. OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: CALLER - String identifying the calling routine. DEFAULT - Value to return in param if undefined and undefined allowed. DIMEN - Dimensions of variable. NPTS - Total number of elements in variable. RANK - Rank of variable. TYPE - Type of variable. OUTPUTS: Return value is true if the parameter is bad. False if good. COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: 3/24/93 - Written by Marc W. Buie, Lowell Observatory. 4/27/93 - MWB, added TYPE and DEFAULT keywords. 2000/11/1, MWB, added new types for IDL v5.4 2007/08/14, MWB, fixed bug with returning DIMEN on defaulted variable.