;+ ; ; @file_comments ; display an ASCII file in a widget. ; It is the same thing that xdisplayfile but here, we use it ; to display the content of a procedure or of a function located in the !path ; ".pro" suffix will be appended if needed. ; ; @categories ; Utilities ; ; @param FILENAME {in}{required} ; It is the name of the procedure or of the function ; we want to display (with or without .pro at the end). ; ; @keyword _EXTRA ; Used to pass keywords to xdisplayfile ; ; @examples ; IDL> xfile,'plt' ; ; @history ; Sebastien Masson (smasson\@lodyc.jussieu.fr) ; 7/1/99 ; 6/7/1999: compatibility mac and windows ; ; @version ; $Id$ ; ;- ; PRO xfile, filename, _EXTRA = ex ; compile_opt idl2, strictarrsubs ; ; Are we sure filename is a string? intype = size(filename, /type) if intype NE 7 then begin dummy = report('Input parameter must be a string and not a '+size(filename, /tname)) return endif ; find the file and display it! pfile = find(filename, /first_found) IF pfile NE 'NOT_FOUND' THEN xdisplayfile, pfile[0], _extra = ex $ ELSE dummy = report(filename + ' does not exist ...') return end