idlastro / Miscellaneous (Non-Astronomy) Procedures: ZPARCHECK

[Source code]

NAME
ZPARCHECK
PURPOSE
Routine to check user parameters to a procedure
CALLING SEQUENCE
zparcheck, progname, parameter, parnum, types, dimens, [ message ]
INPUTS
progname  - scalar string name of calling procedure
parameter - parameter passed to the routine
parnum    - integer parameter number
types     - integer scalar or vector of valid types
         1 - byte        2 - integer   3 - int*4
         4 - real*4      5 - real*8    6 - complex
         7 - string      8 - structure 9 - double complex
        10 - pointer    11 - object ref 12 - Unsigned integer
        13 - unsigned int*4 
        14 - int*8  
        15 - Unsigned int*8
dimens   - integer scalar or vector giving number
              of allowed dimensions.
OPTIONAL INPUT
message - string message describing the parameter to be printed if an 
        error is found
OUTPUTS
none
EXAMPLE
IDL> zparcheck, 'HREBIN', hdr, 2, 7, 1, 'FITS Image Header'
This example checks whether the parameter 'hdr' is of type string (=7)
and is a vector (1 dimension).   If either of these tests fail, a 
message will be printed
        "Parameter 2 (FITS Image Header) is undefined"
        "Valid dimensions are 1"
        "Valid types are string"        
SIDE EFFECTS
If an error in the parameter is a message is printed
a RETALL issued
HISTORY
version 1  D. Lindler  Dec. 86
documentation updated.  M. Greason, May 1990.
Recognize double complex datatype    W. Landsman   September 1995
Converted to IDL V5.0   W. Landsman   September 1997
Check for new data types (e.g. unsigned) W. Landsman February 2000
Print a traceback if an error occurs  W. Landsman  Aug 2011