Changeset 69 for trunk/Utilities/createpro.pro
- Timestamp:
- 05/11/06 12:35:53 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Utilities/createpro.pro
r11 r69 24 24 ; must start with a ',' for example: KWDLIST = ', TOTO = toto' 25 25 ; 26 ; KWDUSED: a vector string. to specify a list of keywords that 27 ; must be used when executing the created procedure. Warning: the string 28 ; must start with a ',' for example: KWDLIST = ', TOTO = toto' 26 ; _EXTRA: used to pass your keywords to the created procedure. 29 27 ; 30 28 ; OUTPUTS: none … … 41 39 ; IDL> , filename = 'test', kwdlist =', ok = ok' 42 40 ; IDL> createpro, ['if keyword_set(ok) then print,''OK'' else print, ''No'''] $ 43 ; IDL> , filename = 'test', kwdlist = ', ok = ok', kwdused = ', /ok'41 ; IDL> , filename = 'test', kwdlist = ', ok = ok', /ok 44 42 ; 45 43 ; 46 44 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 47 45 ; cleaning + new keywords: October 2005 46 ; Feb. 2006: supress keyword "kwdused" and use call_procedure instead of execute 48 47 ;- 49 48 ;------------------------------------------------------------ … … 51 50 ;------------------------------------------------------------ 52 51 PRO createpro, command, FILENAMEIN = filenamein $ 53 , KWDLIST = kwdlist, KWDUSED = kwdused 54 52 , KWDLIST = kwdlist, KWDUSED = kwdused, _extra = ex 53 ; 54 compile_opt idl2, hidden, strictarrsubs 55 ; 56 IF keyword_set(kwdused) THEN BEGIN 57 dummy = report(['keyword KWDUSED has been suppressed,' $ 58 , 'please pass directly your keywords through _extra,' $ 59 , 'see exaemples in createpro header']) 60 return 61 ENDIF 55 62 ; define filename if needed 56 63 if NOT keyword_set(filenamein) then filename = 'for_createpro.pro' $ … … 66 73 ; create the file 67 74 if NOT keyword_set(kwdlist) then kwdlist = '' 75 kwdlist = kwdlist + ', _extra = ex' 76 ; for i = 0, n_elements(command)-1 do print, command[i] 68 77 putfile, filename, ['pro ' + shortfilename + kwdlist $ 69 , command, 'return', 'end']78 , 'compile_opt idl2, hidden, strictarrsubs', command, 'return', 'end'] 70 79 ; go in dirname directory 71 80 cd, dirname, current = old_dir … … 74 83 cd, old_dir 75 84 ; execute it 76 if NOT keyword_set(kwdused) then kwdused = '' 77 dummy = execute(shortfilename + kwdused) 85 call_procedure, shortfilename, _extra = ex 78 86 ; 79 87 return
Note: See TracChangeset
for help on using the changeset viewer.