Ignore:
Timestamp:
07/21/06 14:47:49 (18 years ago)
Author:
navarro
Message:

english and nicer header (2a)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/ToBeReviewed/STRING/chkeywd.pro

    r134 r142  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME: chkeywd (change keyword) 
    65; 
    7 ; PURPOSE: ds un string qui contient une commande a executer avec 
    8 ; EXECUTE par ex. On change la valeur d''un des mot cle. 
    9 ; Plus generalement, ds un string, on cherche la chaine de 
    10 ; chacarteres: ', keywdname= ..., et on change la valeur de ... 
     6; @file_comments 
     7; In a string containing an order to executewith EXECUTE by example.  
     8; We change the value of one of keywords. 
     9; More generally, in a string, we look for the caracter chain: ', keywdname= ..., 
     10; and we change the value of... 
    1111; 
    12 ; CATEGORY: pour bidouiller des commandes passees par execute 
     12; @categories 
     13; string, keywords 
    1314; 
    14 ; CALLING SEQUENCE: stringout=chkeywd(stringin, keywdname, keywdvalue) 
    1515;  
    16 ; INPUTS: 
    17 ;      stringin: un string 
    18 ;      keywdname: un string designant le nom du mot clef a chercher. 
    19 ;      keywdvalue: nouvelle valeur du mot clef a considerer ds stringin 
     16; @param STRINGIN {in}{required} 
     17; it is a string 
    2018; 
    21 ; KEYWORD PARAMETERS: 
    22 ;      pour chercher le mot cle, on cherche le premier signe = qui 
    23 ;      suit la position de keywdname. on substitue 
    24 ;      pardefaut tout le bout de string qui suit jusqu''a la prochaine 
    25 ;      virgule. avec les mots cles SEPARATOR et AFTER on peut modifier 
    26 ;      cette decoupe du string: 
    27 ;      SEPARATOR donne un chatactere avant (ou apres si AFTER est 
    28 ;      active) lequel il faut chercher la virgule qui delimite le mot 
    29 ;      cle ds le string. cf. les exemples 
     19; @param KEYWDNAME {in}{required} 
     20; it is a string designating the name of keyword to look for. 
    3021; 
    31 ; OUTPUTS:stringout=stringin modifie si keywdname a ete trouve ds 
    32 ; stringin 
     22; @param KEYWDVALUE {in}{required}  
     23; The new value of the keyword to considerate in STRINGIN 
    3324; 
    34 ; COMMON BLOCKS:common.pro 
     25; @keyword SEPARATOR 
     26; To look for the keyword, we look for the first sign = which follow  
     27; the position of keywdname. By default, we substitute the string  
     28; before the comma. With the keyword SEPARATOR,we can modify the cut  
     29; of the string. SEPARATOR give a caractere before the one we have to  
     30; look for the comma which delimit the keyword in the string. 
     31; (see examples) 
    3532; 
    36 ; SIDE EFFECTS: 
    37 ;    
    38 ;   Si keywdvalue est un tableau, il sera convertit en vecteur. 
     33; @keyword AFTER 
     34; To look for the keyword, we look for the first sign = which follow  
     35; the position of keywdname. By default, we substitute the string  
     36; before the comma. With the keyword AFTER,we can modify the cut  
     37; of the string. AFTER give a caractere after the one we have to  
     38; look for the comma which delimit the keyword in the string. 
     39; (see examples) 
    3940; 
    40 ; RESTRICTIONS: 
     41; @returns  
     42; stringout=stringin modified if keywdname has been found in stringin 
    4143; 
    42 ;   attention cette fonction comporte des boucles, des if et des cases 
    43 ;   ds tous les sens. Elle ne doit donc pas etre utilisee avec des 
    44 ;   mots clefs de grosse taille (avec bcp d''elements et avec des 
    45 ;   elements etant de gros tableaux). 
    46 ;   le mot clef en entree ne doit pas contenir de Complex floating, de 
    47 ;   structure, de Double-precision complex, de Pointer, de Object 
    48 ;   reference, de Unsigned Integer, de Unsigned Longword Integer, de 
    49 ;   64-bit Integer, de Unsigned 64-bit Integer   
     44; @uses  
     45; common.pro 
    5046; 
    51 ; EXAMPLE: 
     47; @restrictions 
     48; If keywdvalue is an array, it will be convert in a vector. 
     49; 
     50; @restrictions 
     51; Beware, this function has loops, ifs ad cases everywhere. So it can  
     52; not be used by big keywords (with a lot of elements which are big  
     53; arrays). The input keyword must not contain Complex floatings, structure,  
     54; Double-precision complex, Pointer, Object reference, Unsigned Integer,  
     55; Unsigned Longword Integer, 64-bit Integer or Unsigned 64-bit Integer. 
     56;  
     57; 
     58; @examples 
    5259; 
    5360;   IDL> b='ok=111, year=[1997,1998,1999], age_capitaine=35' 
     
    6471;   ok=111, year='c''est bon', /age_capitaine 
    6572; 
    66 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
     73; @history 
     74; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    6775;                      18/10/1999 
    68 ;                      24/11/1999: adaptation pour les mots cles 
    69 ;                      commencant par / 
     76;                      24/11/1999: adaptation for keywords starting by / 
     77;  
     78; @version 
     79; $Id$ 
     80; 
    7081;- 
    7182;------------------------------------------------------------ 
     
    8192   if poskeywd EQ -1 then return, stringout 
    8293   while poskeywd NE -1 do BEGIN 
    83 ; changer un mot cle qui commence par /toto 
     94; change a keyword starting by /toto 
    8495      if strmid(stringout,poskeywd-1,1) EQ '/' then BEGIN 
    8596         ajoute = keywdname+'='+tostr(keywdvalue) 
     
    8899         poskeywd = strpos(stringout, keywdname, poskeywd) 
    89100      ENDIF ELSE BEGIN  
    90 ; changer un mot cle qui commence par toto= 
     101; change a keyword sarting by toto= 
    91102         posegal = strpos(stringout, '=', poskeywd) 
    92103         if posegal EQ -1 then return, stringout 
Note: See TracChangeset for help on using the changeset viewer.