Ignore:
Timestamp:
05/23/06 15:45:47 (18 years ago)
Author:
smasson
Message:

debug xxx and cie + clean data file + rm perldoc_idl

File:
1 edited

Legend:

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

    r69 r74  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:createpro 
     5; NAME:createfunc 
    66; 
    7 ; PURPOSE: write an idl procedure, compile it and execute it. 
     7; PURPOSE: write an idl function, compile it and execute it. 
     8;          usefull to avoid the use of execute 
    89; 
    910; CATEGORY: 
    1011; 
    11 ; CALLING SEQUENCE:createpro, command 
     12; CALLING SEQUENCE:res = createfunc(command) 
    1213;  
    1314; INPUTS: 
    14 ;      command: a string array defining the procedure to be created. 
    15 ;      each element will be a line of the created procedure.  
     15;      command: a scalar string defining the result to be byven back by the 
     16;               function. (see examples) 
    1617; 
    1718; KEYWORD PARAMETERS: 
    1819; 
    19 ;      FILENAMEIN: name of the procedure to be created. 
    20 ;      'for_createpro.pro' by default 
     20;      FILENAMEIN: name of the funccedure to be created. 
     21;      'for_createfunc.pro' by default 
    2122; 
    2223;      KWDLIST: a vector string. to specify a list of keywords that 
    23 ;      must be included in the procedure definition. Warning: the string 
     24;      must be included in the function definition. Warning: the string 
    2425;      must start with a ',' for example: KWDLIST = ', TOTO = toto' 
    2526; 
    26 ;      _EXTRA: used to pass your keywords to the created procedure. 
     27;      _EXTRA: used to pass your keywords to the created function. 
    2728; 
    2829; OUTPUTS: none  
     
    3031; COMMON BLOCKS: none 
    3132; 
    32 ; SIDE EFFECTS: ends teh procedure name with '.pro' if needed 
     33; SIDE EFFECTS: ends the function name with '.pro' if needed 
    3334; 
    34 ; RESTRICTIONS:de marche pas pour les fonctions 
     35; RESTRICTIONS:arguments can be given only through keywords 
    3536; 
    3637; EXAMPLE: 
    37 ;      IDL> createpro, ['print,''OK'''], filename='test' 
    38 ;      IDL> createpro, ['if keyword_set(ok) then print,''OK'' else print, ''No'''] $ 
    39 ;      IDL>   , filename = 'test', kwdlist =', ok = ok'  
    40 ;      IDL> createpro, ['if keyword_set(ok) then print,''OK'' else print, ''No'''] $ 
    41 ;      IDL>   , filename = 'test', kwdlist = ', ok = ok', /ok  
    42 ; 
     38;      IDL> print, createfunc('3*2', filename='test') 
     39;      IDL> print, createfunc('3*two', filename = 'test' $ 
     40;                                    , kwdlist ='two = two', two = 2) 
    4341; 
    4442; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
    45 ; cleaning + new keywords: October 2005 
    46 ; Feb. 2006: supress keyword "kwdused" and use call_procedure instead of execute 
     43;                      May 2005 
    4744;- 
    4845;------------------------------------------------------------ 
     
    5451  compile_opt idl2, hidden, strictarrsubs 
    5552; 
     53  IF n_elements(command) NE 1 THEN stop 
    5654; define filename if needed 
    5755  if NOT keyword_set(filenamein) then filename = 'for_createfunc.pro' $ 
     
    6866   if NOT keyword_set(kwdlist) then kwdlist = '' 
    6967   kwdlist = kwdlist + ', _extra = ex' 
     68   IF strmid(kwdlist, 0, 1) NE ',' THEN kwdlist = ', ' +  kwdlist 
    7069   putfile, filename, ['function ' + shortfilename + kwdlist $ 
    7170                       , 'compile_opt idl2, hidden, strictarrsubs' $ 
Note: See TracChangeset for help on using the changeset viewer.