FUNCTION checkext,name ; This function returns the number of characters in the extension ; of the file 'name'. If multiple files exist with the same 'name' ; and different extensions, the first one is selected. nm=name & pt=STRPOS(nm,'.') IF pt EQ -1 THEN nm=nm+'.*' IF pt EQ STRLEN(nm)-1 THEN nm=nm+'*' files=FINDFILE(nm) pos=-1 REPEAT BEGIN last=pos+1 pos=STRPOS(files(0),'.',last) ENDREP UNTIL pos EQ -1 IF last EQ 0 THEN BEGIN PRINT,'checkext : can''t find filename extension' RETURN,0 ENDIF ELSE BEGIN ext=STRMID(files(0),last,STRLEN(files(0))-last) RETURN,STRLEN(ext) ENDELSE END