<< prev file | next file >>    view single page | view frames    summary: fields | routine    details: routine

ToBeReviewed/STRING/

chkeywd.pro

topchkeywd

result = chkeywd(stringin, keywdname, keywdvalue, SEPARATOR=SEPARATOR, AFTER=AFTER)

NAME: chkeywd (change keyword) PURPOSE: ds un string qui contient une commande a executer avec EXECUTE par ex. On change la valeur d''un des mot cle. Plus generalement, ds un string, on cherche la chaine de chacarteres: ', keywdname= ..., et on change la valeur de ... CATEGORY: pour bidouiller des commandes passees par execute CALLING SEQUENCE: stringout=chkeywd(stringin, keywdname, keywdvalue) INPUTS: stringin: un string keywdname: un string designant le nom du mot clef a chercher. keywdvalue: nouvelle valeur du mot clef a considerer ds stringin KEYWORD PARAMETERS: pour chercher le mot cle, on cherche le premier signe = qui suit la position de keywdname. on substitue pardefaut tout le bout de string qui suit jusqu''a la prochaine virgule. avec les mots cles SEPARATOR et AFTER on peut modifier cette decoupe du string: SEPARATOR donne un chatactere avant (ou apres si AFTER est active) lequel il faut chercher la virgule qui delimite le mot cle ds le string. cf. les exemples OUTPUTS:stringout=stringin modifie si keywdname a ete trouve ds stringin COMMON BLOCKS:common.pro SIDE EFFECTS: Si keywdvalue est un tableau, il sera convertit en vecteur. RESTRICTIONS: attention cette fonction comporte des boucles, des if et des cases ds tous les sens. Elle ne doit donc pas etre utilisee avec des mots clefs de grosse taille (avec bcp d''elements et avec des elements etant de gros tableaux). le mot clef en entree ne doit pas contenir de Complex floating, de structure, de Double-precision complex, de Pointer, de Object reference, de Unsigned Integer, de Unsigned Longword Integer, de 64-bit Integer, de Unsigned 64-bit Integer EXAMPLE: IDL> b='ok=111, year=[1997,1998,1999], age_capitaine=35' IDL> print, b ok=111, year=[1997,1998,1999], age_capitaine=35 IDL> print, chkeywd(b,'ok','c''est bon') ok='c''est bon', year=[1997,1998,1999], age_capitaine=35 IDL> print, chkeywd(b,'YEAR',indgen(5),sep='=') ok=111, year=[0,1,2,3,4], age_capitaine=35 IDL> print, chkeywd(b,'YEAR',indgen(5),sep=']',/after) ok=111, year=[0,1,2,3,4], age_capitaine=35 IDL> b='ok=111, /year, /age_capitaine' IDL> print, chkeywd(b,'year','c''est bon') ok=111, year='c''est bon', /age_capitaine

Parameters

stringin       

keywdname       

keywdvalue       

Keywords

SEPARATOR       

AFTER       

Produced by IDLdoc 2.0.