Changeset 266 for trunk/SRC/Utilities/xfile.pro
- Timestamp:
- 08/24/07 14:27:48 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Utilities/xfile.pro
r262 r266 8 8 ; 9 9 ; @categories 10 ; Utilities 10 ; Utilities Widget 11 11 ; 12 ; @param FILENAME {in}{required} 12 ; @param FILENAME {in}{required} {type=scalar string} 13 13 ; It is the name of the procedure or of the function 14 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. 15 17 ; 16 18 ; @keyword _EXTRA 17 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. 18 23 ; 19 24 ; @examples … … 34 39 compile_opt idl2, strictarrsubs 35 40 ; 41 usage="xfile, filename, _EXTRA = ex" 42 ; 43 ; check parameters 44 check_param = N_PARAMS() 45 if (check_param EQ 0) then begin 46 dummy = report(['No input parameter', $ 47 'Usage : ' + usage]) 48 return 49 endif 50 ; 51 ; check arguments 52 if arg_present(filename) then begin 53 dummy = report(['No input parameter filename', $ 54 'Usage : ' + usage]) 55 return 56 endif 57 ; 36 58 ; Are we sure filename is a string? 37 59 intype = size(filename, /type) 38 60 if intype NE 7 then begin 39 dummy = report('Input parameter must be a string and not a '+size(filename, /tname)) 61 dummy = report(['Input parameter filename type : ' + size(filename,/TNAME) , $ 62 'Input parameter filename must be a string']) 40 63 return 41 64 endif 65 ; 42 66 ; find the file and display it! 43 67 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 68 if (pfile NE 'NOT FOUND') then begin 69 xdisplayfile, pfile[0], _EXTRA = ex 70 endif else begin 71 dummy = report(['Input parameter filename : ' + filename, $ 72 filename + ' does not exist ...']) 73 endelse 74 ; 47 75 return 48 76 end
Note: See TracChangeset
for help on using the changeset viewer.