; ; $Header: ; function cg_get_filename,infile ; ; History ; Derived by aj from "flat file" get_filename.pro - 9/27/99 ; ;verify file exists listt=findfile(infile,count=tally) IF tally le 0 then begin print,'ERROR: ',infile+' not found.' return,'NONE_FOUND' ENDIF ;stop select=0 IF tally gt 1 then begin present:select=-1 print,'' FOR i=0,n_elements(listt)-1 do print,strcompress(i+1,/remove_all)+' '+t(i) print,'' stop print,format='($, "Enter the number of the file you want")' read,select select = select - 1 IF select lt 0 or select gt n_elements(listt) then goto,present ENDIF file=listt(select) ;print,'accessing: '+file return,file end