source: trunk/SRC/Utilities/xfile.pro @ 239

Last change on this file since 239 was 239, checked in by smasson, 17 years ago

cleaning + minor bugfix related to the path definition

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1;+
2;
3; @file_comments
4; display in a widget an ASCII file.
5; It is the same thing that <proidl>xdisplayfile<proidl> but here, we use it
6; to display the content of a procedure or of a function located in the !path
7; ".pro" suffix will be appended if needed.
8;
9; @categories
10; Utilities
11;
12; @param FILENAME {in}{required}
13; It is the name of the procedure or of the function
14; we want to display (with or without .pro at the end).
15;
16; @keyword _EXTRA
17; Used to pass keywords to <proidl>xdisplayfile</proidl>
18;
19; @examples
20; IDL> xfile,'plt'
21;
22; @history
23; Sebastien Masson (smasson\@lodyc.jussieu.fr)
24; 7/1/99
25; 6/7/1999: compatibility mac and windows
26;
27; @version
28; $Id$
29;
30;-
31;
32PRO xfile, filename, _EXTRA = ex
33;
34  compile_opt idl2, strictarrsubs
35;
36; Are we sure filename is a string?
37   intype = size(filename, /type)
38   if intype NE 7 then begin
39      dummy = report('Input parameter must be a string and not a '+size(filename, /tname))
40      return
41   endif
42; find the file and display it!
43   pfile = find(filename, /first_found)
44   IF pfile NE 'NOT_FOUND' THEN xdisplayfile, pfile[0], _extra = ex $
45   ELSE dummy = report(filename + ' does not exist ...')
46
47   return
48end
Note: See TracBrowser for help on using the repository browser.