Changeset 118 for trunk/SRC/Utilities/createfunc.pro
- Timestamp:
- 06/27/06 17:47:06 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Utilities/createfunc.pro
- Property svn:keywords set to Id
r97 r118 6 6 ; usefull to avoid the use of execute 7 7 ; 8 ; @param command {in}{required} a scalar string defining the result to be byven back by the function. (see examples) 8 ; @param command {in}{required} a scalar string defining the result to be 9 ; given back by the function. (see examples) 9 10 ; 10 11 ; @keyword FILENAMEIN {in} name of the funccedure to be created. 11 12 ; 'for_createfunc.pro' by default 13 ; 12 14 ; @keyword KWDLIST {in} a vector string. to specify a list of keywords that 13 15 ; must be included in the function definition. Warning: the string … … 16 18 ; @keyword _EXTRA used to pass your keywords to the created function. 17 19 ; 18 ; SIDE EFFECTS: ends the function name with '.pro' if needed 20 ; @restrictions 21 ; - arguments can be given only through keywords; 22 ; - ends the function name with '.pro' if needed. 19 23 ; 20 ; @restrictions arguments can be given only through keywords 21 ; 22 ; @examples 24 ; @examples 23 25 ; IDL> print, createfunc('3*2', filename='test') 24 26 ; IDL> print, createfunc('3*two', filename = 'test' $ … … 27 29 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 28 30 ; May 2005 31 ; 32 ; @version $Id$ 33 ; 29 34 ;- 30 35 ;------------------------------------------------------------ … … 32 37 ;------------------------------------------------------------ 33 38 FUNCTION createfunc, command, FILENAMEIN = filenamein $ 34 , KWDLIST = kwdlist, _ extra= ex39 , KWDLIST = kwdlist, _EXTRA = ex 35 40 ; 36 41 compile_opt idl2, hidden, strictarrsubs … … 39 44 ; define filename if needed 40 45 if NOT keyword_set(filenamein) then filename = 'for_createfunc.pro' $ 41 ELSE filename = filenamein 46 ELSE filename = filenamein 42 47 ; get the name of the function (not the name of the file containing the function) 43 48 shortfilename = file_basename(filename, '.pro') … … 50 55 ; create the file 51 56 if NOT keyword_set(kwdlist) then kwdlist = '' 52 kwdlist = kwdlist + ', _ extra= ex'57 kwdlist = kwdlist + ', _EXTRA = ex' 53 58 IF strmid(kwdlist, 0, 1) NE ',' THEN kwdlist = ', ' + kwdlist 54 59 putfile, filename, ['function ' + shortfilename + kwdlist $ … … 63 68 cd, old_dir 64 69 ; execute it 65 res = call_function(shortfilename, _ extra= ex)70 res = call_function(shortfilename, _EXTRA = ex) 66 71 ; 67 72 return, res
Note: See TracChangeset
for help on using the changeset viewer.