Changeset 269


Ignore:
Timestamp:
08/27/07 11:46:41 (17 years ago)
Author:
pinsard
Message:

add revision in report message. see 65.

Location:
trunk/SRC/Utilities
Files:
3 edited

Legend:

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

    r243 r269  
    2626; 
    2727; @examples 
    28 ; IDL> print, createfunc('3*2', filename='test') 
    29 ; IDL> print, createfunc('3*two', filename = 'test' $ 
    30 ; IDL>                          , kwdlist ='two = two', two = 2) 
     28; IDL> print, createfunc('3*2', FILENAMEIN='test') 
     29; IDL> print, createfunc('3*two', FILENAMEIN='test' $ 
     30; IDL>                          , KWDLIST='two = two', TWO=2) 
    3131; 
    3232; @history 
     
    4444  compile_opt idl2, hidden, strictarrsubs 
    4545; 
    46   IF n_elements(command) NE 1 THEN stop 
     46  usage="result=createfunc(command, FILENAMEIN=filenamein , KWDLIST=kwdlist, _EXTRA=ex)" 
     47; 
     48  IF n_elements(command) NE 1 THEN BEGIN 
     49    dummy = report(['Input parameter command empty', $ 
     50                    'Usage : ' + usage]) 
     51    stop 
     52  ENDIF 
    4753; define filename if needed 
    4854  if NOT keyword_set(filenamein) then filename = 'for_createfunc.pro' $ 
  • trunk/SRC/Utilities/createpro.pro

    r243 r269  
    2929; 
    3030; @examples 
    31 ; IDL> createpro, ['print,''OK'''], filename='test' 
     31; IDL> createpro, ['print,''OK'''], FILENAMEIN='test' 
    3232; IDL> createpro, ['if keyword_set(ok) then print,''OK'' else print, ''No'''] $ 
    33 ; IDL>   , filename = 'test', kwdlist =', ok = ok' 
     33; IDL>   , FILENAMEIN='test', KWDLIST =', ok = ok' 
    3434; IDL> createpro, ['if keyword_set(ok) then print,''OK'' else print, ''No'''] $ 
    35 ; IDL>   , filename = 'test', kwdlist = ', ok = ok', /ok 
     35; IDL>   , FILENAMEIN='test', KWDLIST= ', ok = ok', /ok 
    3636; 
    3737; @history 
     
    5252  IF keyword_set(kwdused) THEN BEGIN 
    5353    dummy = report(['keyword KWDUSED has been suppressed,' $ 
    54                     , 'please pass directly your keywords through _extra,' $ 
     54                    , 'please pass directly your keywords through _EXTRA,' $ 
    5555                    , 'see examples in createpro header']) 
    5656    return 
  • trunk/SRC/Utilities/report.pro

    r266 r269  
    9999; If we do not ask any question, we just make a print 
    100100  IF NOT keyword_set(question) THEN BEGIN 
    101     IF keyword_set(simple) THEN prefix = '' ELSE prefix = '% '+routine_name(1)+': ' 
    102     if n_elements(text) GT 1 THEN $ 
     101    IF keyword_set(simple) THEN prefix = '' ELSE BEGIN 
     102;    Look for the revsion in the code of the procedure/function calling this  
     103;    report function (ie the one where an problem was detected) in the first 
     104;    occurence of the form : 
     105;    "; $Id$" 
     106     split=STRSPLIT(routine_name(1), ' ', /EXTRACT)   
     107     fileroutine=split[1] 
     108     coderoutine = getfile(fileroutine) 
     109     idline = where(stregex(coderoutine,'^; \$Id: .* .* .* .* \$', /boolean) EQ 1, cnt1) 
     110     IF (idline GT 0) THEN BEGIN 
     111       split=STRSPLIT(coderoutine[idline],' ', /EXTRACT) 
     112       revision=split[3] 
     113       prefix = '% '+routine_name(1)+ ' ' + revision + ': ' 
     114     ENDIF ELSE BEGIN 
     115       prefix = '% '+routine_name(1)+': ' 
     116     ENDELSE 
     117    ENDELSE 
     118    IF n_elements(text) GT 1 THEN $ 
    103119      for i = 0, n_elements(text)-2 do print, prefix+text[i] 
    104     print, prefix+text[n_elements(text)-1] 
    105   ENDIF 
     120      print, prefix+text[n_elements(text)-1] 
     121    ENDIF 
    106122 
    107123   return,  res 
Note: See TracChangeset for help on using the changeset viewer.