pro dbfind_entry,type,svals,nentries,values,Count = count ;+ ; NAME: ; DBFIND_ENTRY ; PURPOSE: ; Subroutine of DBFIND to perform an entry number search ; EXPLANATION: ; This is a subroutine of dbfind and is not a standalone procedure ; It performs a entry number search. ; ; CALLING SEQUENCE: ; dbfind_entry, type, svals, nentries, values, [COUNT = ] ; ; INPUTS: ; type - type of search (output from dbfparse) ; svals - search values (output from dbfparse) ; values - array of values to search ; OUTPUT: ; good - indices of good values ; OPTIONAL OUTPUT KEYWORD: ; Count - integer scalar giving the number of valid matches ; SIDE EFFECTS" ; The obsolete system variable !err is set to number of good values ; ; REVISION HISTORY: ; D. Lindler July,1987 ; Fixed test for final entry number W. Landsman Sept. 95 ; Converted to IDL V5.0 W. Landsman September 1997 ; Added COUNT keyword, deprecate !ERR W. Landsman March 2000 ; Better checking of out of range values W. Landsman February 2002 ;- sv0=long(strtrim(svals[0],2)) & sv1=long(strtrim(svals[1],2)) if values[0] eq -1 then begin ;start with all entries case type of 0: begin if (sv0 gt 0) and (sv0 le nentries) then begin ;Update Sep 95 values=lonarr(1)+sv0 count=1 end else count= 0 end -1: begin if nentries LT sv0 then count = 0 else begin values=lindgen(nentries-sv0+1) + sv0 ;value>sv0 count=nentries-sv0+1 endelse end -2: begin values= lindgen(sv1>111 sv1=sv11 maxv=(sv0+abs(sv1))sv0 -2: good=where(values le sv1, count) ;value