function WSWHERE, v ;+ ; NAME: ; WSWHERE ; ; PURPOSE: ; Same as 'where' function, except always returns a scalar, ; never a vector. ; ; CATEGORY: ; array ; ; CALLING SEQUENCE: ; r = WSWHERE(v) ; ; INPUTS: ; v = variable to use 'where' on ; ; OUTPUTS: ; r = return code ; if where(v) is a scalar, r = where(v) ; if where(v) is a vector, r = w(0), where w = where(v) ; ; RESTRICTIONS: ; Object and search_string must be of type string. ; ; REQUIRED ROUTINES: ; IDL Library: where, size, lonarr ; ; MODIFICATION HISTORY: ; T.Atwater 910510 -- Created ;Renamed from swhere.pro by Amara Graps for Wavelet Workbench, March 1996. ;- i = WHERE(v) s = SIZE(i) IF s(0) EQ 0 THEN RETURN, i ELSE RETURN, i(0) END