;+ ; NAME: ; ; PURPOSE: ; ; CATEGORY: ; ; CALLING SEQUENCE: ; ; INPUTS: ; ; OPTIONAL INPUTS: ; ; KEYWORD PARAMETERS: ; ; OUTPUTS: ; ; OPTIONAL OUTPUTS: ; ; COMMON BLOCKS: ; ; SIDE EFFECTS: ; ; RESTRICTIONS: ; ; PROCEDURE: ; ; EXAMPLE: ; ; SEE ALSO: ; ; MODIFICATION HISTORY: ; Written by: Your name here, Date. ;- FUNCTION filocate,year,month,day,cam,filt $ ,verbose=verbose,bgs=bgs,ray=ray ; Set up OS-dependent parameters @isitdos ; define file name for desired file testpatt=STRING(year MOD 100,month,day,cam,filt,FORMAT='(3I2.2,2I1,".")') CASE 1 OF KeyWord_Set(bgs): testpatt=testpatt+'bgs' KeyWord_Set(ray): testpatt=testpatt+'ray' ELSE: testpatt=testpatt+'*' ENDCASE ; Check each possible location until a match is found dptr=-1 REPEAT BEGIN dptr=dptr+1 dir=saveroot(dptr)+dd IF KEYWORD_SET(verbose) THEN HELP,dptr,dir,testpatt ; make list of available files of desired type files=rfindfile(dir+testpatt,count=nfiles) files=files(SORT(files)) IF KEYWORD_SET(verbose) THEN HELP,files,nfiles CASE nfiles OF 0: template='' 1: BEGIN PRINT,files(0)+' available; opening file' template=files(0) END ELSE: BEGIN PRINT,'Files available:' FOR i=0,nfiles-1 DO PRINT,i,files(i),FORMAT='(I1,2X,A)' READ,'Select the file to display: ',nd template=files(nd) END ENDCASE ENDREP UNTIL (template NE '') OR (dptr EQ (N_ELEMENTS(saveroot)-1)) RETURN,template END