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

Last change on this file since 327 was 327, checked in by pinsard, 17 years ago

modification of headers : mainly blanks around = sign for keywords in declaration of function and pro

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
1;+
2;
3; @file_comments
4; display an ASCII file in a widget.
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 Widget
11;
12; @param FILENAME {in}{required} {type=scalar string}
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; FILENAME should be located in !path.
16; ".pro" suffix will be appended if needed.
17;
18; @keyword _EXTRA
19; Used to pass keywords to <proidl>XDISPLAYFILE</proidl>
20;
21; @restrictions
22; Triggers the <proidl>XMANAGER</proidl> if it is not already in use.
23;
24; @examples
25; IDL> xfile,'plt'
26;
27; @history
28; Sebastien Masson (smasson\@lodyc.jussieu.fr)
29; 7/1/99
30; 6/7/1999: compatibility mac and windows
31;
32; @version
33; $Id$
34;
35;-
36PRO xfile, filename, _EXTRA=ex
37;
38  compile_opt idl2, strictarrsubs
39;
40  usage="xfile, filename, _EXTRA = ex"
41;
42; check parameters
43  check_param = N_PARAMS()
44  if (check_param EQ 0) then begin
45     dummy = report(['No input parameter', $
46                     'Usage : ' + usage])
47     return
48  endif
49;
50; check arguments
51  if arg_present(filename) then begin
52     dummy = report(['No input parameter filename', $
53                     'Usage : ' + usage])
54     return
55  endif
56;
57; Are we sure filename is a string?
58   intype = size(filename, /type)
59   if intype NE 7 then begin
60      dummy = report(['Input parameter filename type : ' + size(filename,/TNAME) , $
61                      'Input parameter filename must be a string'])
62      return
63   endif
64;
65; find the file and display it!
66   pfile = find(filename, /firstfound)
67   if (pfile NE 'NOT FOUND') then begin
68     xdisplayfile, pfile[0], _EXTRA = ex
69   endif else begin
70     dummy = report(['Input parameter filename : ' + filename, $
71                     filename + ' does not exist ...'])
72   endelse
73;
74   return
75end
Note: See TracBrowser for help on using the repository browser.