Ignore:
Timestamp:
08/24/07 14:27:48 (17 years ago)
Author:
pinsard
Message:

bug fix and diagnostics improvements in xfile and xhelp. see 65. typo in some pro files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Utilities/xfile.pro

    r262 r266  
    88; 
    99; @categories 
    10 ; Utilities 
     10; Utilities Widget 
    1111; 
    12 ; @param FILENAME {in}{required} 
     12; @param FILENAME {in}{required} {type=scalar string} 
    1313; It is the name of the procedure or of the function 
    1414; 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. 
    1517; 
    1618; @keyword _EXTRA 
    1719; Used to pass keywords to <proidl>XDISPLAYFILE</proidl> 
     20; 
     21; @restrictions 
     22; Triggers the <proidl>XMANAGER</proidl> if it is not already in use. 
    1823; 
    1924; @examples 
     
    3439  compile_opt idl2, strictarrsubs 
    3540; 
     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; 
    3658; Are we sure filename is a string? 
    3759   intype = size(filename, /type) 
    3860   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']) 
    4063      return 
    4164   endif 
     65; 
    4266; find the file and display it! 
    4367   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; 
    4775   return 
    4876end 
Note: See TracChangeset for help on using the changeset viewer.