Changeset 266


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

Location:
trunk/SRC
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/ToBeReviewed/CALCULS/level2mask.pro

    r231 r266  
    99; 
    1010; @param TAB {in}{required}{type=2d array} 
    11 ; 2d level array of sill level (or a structure respecting litchamp criterions) 
     11; 2d level array of sill level (or a structure respecting <pro>litchamp</pro>  
     12; criterions) 
    1213; 
    1314; @returns 
     
    2021; Sebastien Masson (smasson\@lodyc.jussieu.fr) 
    2122;                       17/6/1999 
    22 ; Setp 2004: boundary level have 0 values and not 1 (as it was 
     23; Sept 2004: boundary level have 0 values and not 1 (as it was 
    2324; explained before in the header). see: 
    2425; print, array_equal(niveau, total(level2mask(niveau),3)) 
    25 ; 
    2626; 
    2727; @version 
  • trunk/SRC/Utilities/report.pro

    r260 r266  
    44; Like <proidl>DIALOG_MESSAGE</proidl> if there is already some widget 
    55; active or like <proidl>MESSAGE</proidl> if there is not any widget active. 
    6 ; To ask a question whose answer is not yes/no, use xquestion. 
     6; To ask a question whose answer is not yes/no, use <pro>xquestion</pro>. 
    77; 
    88; @param TEXT {in}{required} {type=scalar string or arrays of string} 
    9 ; If TEXT is a scalar string, we look for the line feed characters "!C" 
    10 ; comporte qu''un element, on cherche les eventuels caracteres de 
    11 ; retour a la ligne: '!C'. If text is set to an array of strings, each 
     9; If TEXT is a scalar string, we look for the line feed character "!C". 
     10; If TEXT is set to an array of strings, each 
    1211; array element is displayed as a separate line of text. 
    1312; 
     
    7877; do we ask a question ? 
    7978    if keyword_set(question) then BEGIN 
    80 ; what i sthe answer by default ? 
     79; what is the answer by default ? 
    8180      if keyword_set(default_no) then answer = 'n' ELSE answer = 'y' 
    8281      default_answer = answer 
     
    9089        answer = strlowcase(answer) 
    9190      ENDWHILE                  ; 
    92 ; we adjust res in function of th answer 
     91; we adjust res in function of the answer 
    9392      case answer of 
    9493        '':res = default_answer EQ 'y' 
  • 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 
  • trunk/SRC/Utilities/xhelp.pro

    r262 r266  
    55; 
    66; @categories 
    7 ; Widget 
     7; Utilities Widget 
    88; 
    99; @param FILENAME {in}{required} {type=scalar string} 
    10 ; the name of the file to display. 
     10; It is the name of the procedure or of the function 
     11; we want to display (with or without .pro at the end). 
    1112; FILENAME should be located in !path. 
    1213; ".pro" suffix will be appended if needed. 
     
    4142  compile_opt idl2, strictarrsubs 
    4243; 
    43  
     44  usage="xhelp, filename, _EXTRA = ex" 
     45; 
     46; check parameters 
     47  check_param = N_PARAMS() 
     48  if (check_param EQ 0) then begin 
     49     dummy = report(['No input parameter', $ 
     50                     'Usage : ' + usage]) 
     51     return 
     52  endif 
     53; 
     54; check arguments 
     55  if arg_present(filename) then begin 
     56     dummy = report(['No input parameter filename', $ 
     57                     'Usage : ' + usage]) 
     58     return 
     59  endif 
     60; 
    4461; Are we sure filename is a string? 
    4562   intype = size(filename, /type) 
    4663   if intype NE 7 then begin 
    47       dummy = report('Input parameter must be a string and not a '+size(filename, /tname)) 
     64      dummy = report(['Input parameter filename type : ' + size(filename,/TNAME) , $ 
     65                      'Input parameter filename must be a string']) 
    4866      return 
    4967   endif 
     68; 
    5069; find the file and display it! 
    5170   pfile = (find(filename, /first_found))[0] 
    5271; read it 
    53    IF pfile NE 'NOT_FOUND' THEN BEGIN  
     72   IF (pfile NE 'NOT FOUND') THEN BEGIN 
    5473     fulltext = getfile(pfile) 
    5574; find the ";+"and ";-" 
    5675     start = where(stregex(fulltext,'^ *;\+ *$', /boolean) EQ 1, cnt1) 
    5776     ending = where(stregex(fulltext,'^ *;- *$', /boolean) EQ 1, cnt2) 
    58      IF cnt1 EQ 0 OR cnt1 NE cnt2 THEN BEGIN 
     77     IF ((cnt1 EQ 0) OR (cnt1 NE cnt2)) THEN BEGIN 
    5978       dummy = report('file '+pfile+' is badly written, no proper header found... Use xfile') 
    6079       return 
     
    7493       ENDIF 
    7594     ENDFOR 
    76 ; remove the fisrt useless lines 
    77      IF n_elements(header) GT 1 THEN header = header[4:*] ELSE BEGIN  
     95; remove the first useless lines 
     96     IF n_elements(header) GT 1 THEN header = header[4:*] ELSE BEGIN 
    7897       dummy = report('file '+pfile+' has empty header... Use xfile') 
    7998       return 
    8099     ENDELSE 
    81 ;      
     100; 
    82101     xdisplayfile, 'dummy', text = header[1:*], title = pfile, _extra = ex 
    83102; 
    84    ENDIF ELSE dummy = report(filename + ' does not exist ...') 
    85  
     103   endif else begin 
     104     dummy = report(['Input parameter filename : ' + filename, $ 
     105                     filename + ' does not exist ...']) 
     106   endelse 
     107; 
    86108   return 
    87109end 
    88  
Note: See TracChangeset for help on using the changeset viewer.