Blame view

src/idl_misc/isarray.pro 1.43 KB
427f1205   Jean-Michel Glorian   version 4.2 merged
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
;-------------------------------------------------------------
;+
; NAME:
;       ISARRAY
; PURPOSE:
;       Tests if the argument is an array.
; CATEGORY:
; CALLING SEQUENCE:
;       flag = isarray(a)
; INPUTS:
;       a = variable to test.                                in
; KEYWORD PARAMETERS:
; OUTPUTS:
;       flag = test result: 0 if not array, else non-zero.   out
; COMMON BLOCKS:
; NOTES:
; MODIFICATION HISTORY:
;       R. Sterner  20 Mar, 1986.
;       Checked for undefined variables.  RES 25 Aug, 1989.
;       Johns Hopkins Applied Physics Lab.
;
; Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
; This software may be used, copied, or redistributed as long as it is not
; sold and this copyright notice is reproduced on each copy made.  This
; routine is provided as is without any express or implied warranties
; whatsoever.  Other limitations apply as described in the file disclaimer.txt.
;	Converted to IDL V5.0   W. Landsman   September 1997
;-
;-------------------------------------------------------------
 
	function isarray,a, help=hlp
 
	if (n_params(0) lt 1) or keyword_set(hlp) then begin
	  print,' Tests if the argument is an array.' 
	  print,' flag = isarray(a)' 
	  print,'   a = variable to test.                                in'
	  print,'   flag = test result: 0 if not array, else non-zero.   out' 
	  return, -1
	endif
 
	if n_elements(a) eq 0 then return, 0
	s = size(a)
	return, s[0] ne 0
	end