	FUNCTION VAR_TYPE, V 
;+
; Project     :	SOHO - CDS/SUMER
;
; Name        :	VAR_TYPE
;
; Purpose     :	Determine the data type of a variable or parameter.
;
; Explanation :	This function checks what type of variable or parameter has 
;               been passed to it and returns and integer based on the data
;               type of the variable.
;
; Use         :	RESULT = VAR_TYPE (V)
;
;		COLA = 8
;		IF VAR_TYPE (COLA) EQ 1 THEN PRINT, "Variable is an integer."
;		ELSE PRINT, "Variable is not an integer."
;
;               IDL>Variable is an integer.
;
;
; Inputs      :	V	 = Variable to determine data type of.
;
; Opt. Inputs :	None.
;
; Outputs     :	None.
;
; Opt. Outputs:	None.
;
; Result      : The data type of the variable passed to the function as V.
;
;               The data type is represented as integer according to the 
;               following table:
;
;               0      Undefined
;               1      Byte
;               2      Integer
;               3      Longword Integer
;               4      Floating Point
;               5      Double Precision Floating Point
;               6      Complex
;               7      String
;               8      Structure
;
;               If no parameter is passed to this function then the function
;               will return 0 anyway.
;
; Keywords    :	None.
;
; Calls       :	None.
;
; Common      :	None.
;
; Restrictions:	None.
;
; Side effects:	None.
;
; Category    :	Planning, science
;
; Prev. Hist. :	None.

; Written     :	Ron Yurow, 26 October 1995
;
; Modified    :	Version 1, Ron Yurow, 26 October 1995
;
; Version     :	Version 1, 26 October 1995
;-
;
	ON_ERROR, 2
;
;  Check if the an input parameter exists.
;
	IF N_PARAMS() EQ 0 THEN RETURN, 0

;
;  Call the size function to get an array of information about V.
;

        INFO = SIZE (V)

;
;  Find the number of dimensions in V from the array INFO.  
;

        NO_DIMENSIONS = INFO (0)

;
;  Return the data type of V store in the array info.
;

        RETURN, INFO (NO_DIMENSIONS + 1)

        END













