Changeset 142 for trunk/SRC/ToBeReviewed/STRING/strkeywd.pro
- Timestamp:
- 07/21/06 14:47:49 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/STRING/strkeywd.pro
r134 r142 3 3 ;------------------------------------------------------------ 4 4 ;+ 5 ; NAME: strkeywd (string keywords)6 5 ; 7 ; PURPOSE: traduit une sturcture en un string pouvant etre utilise8 ; pour specifier des keywords ds l''appelle d''une fonction qd on9 ; utilise execute (cf l''exemple)6 ; @file_comments 7 ; Translate a sturcture in a string able to be used to specify keywords 8 ; in the calling of a function when we use EXECUTE (see example) 10 9 ; 11 ; CATEGORY: pour passer des mots cles avec execute ! 10 ; @categories 11 ; 12 ; @param STRUCT 13 ; a structure 12 14 ; 13 ; CALLING SEQUENCE:res=strkeywd(struct) 14 ; 15 ; INPUTS:struct: une structure 15 ; @returns 16 ; a string composed like following: 17 ; For each element of the structure, we write a part of the string as: 18 ; 'name_of_the_element=content_of_the_element' 16 19 ; 17 ; KEYWORD PARAMETERS: 20 ; @restrictions 21 ; If an element of the structure contain an array, it will be convert in a vector. 18 22 ; 19 ; OUTPUTS:un string compose de la facon suivante: 20 ; pour chaque element de la structure, on ecrit une partie du 21 ; string sous la forme: 22 ; 'nom_de_l''element=contennu de l''element' 23 ; @restrictions 24 ; Beware, this function has loops, ifs ad cases everywhere. So it can 25 ; not be used by big keywords (with a lot of elements which are big 26 ; arrays). The input keyword must not contain Complex floatings, structure, 27 ; Double-precision complex, Pointer, Object reference, Unsigned Integer, 28 ; Unsigned Longword Integer, 64-bit Integer or Unsigned 64-bit Integer. 23 29 ; 24 ; COMMON BLOCKS: 25 ; 26 ; SIDE EFFECTS: 27 ; 28 ; Si un element de la structure contient un tableau, il sera 29 ; convertit en vecteur. 30 ; 31 ; RESTRICTIONS: 32 ; 33 ; attention cette fonction comporte des boucles, des if et des cases 34 ; ds tous les sens. Elle ne doit donc pas etre utilisee avec des 35 ; structure de grosse taille (avec bcp d''elements et avec des 36 ; elements etant de gros tableaux). 37 ; la structure en entree ne doit pas contenir de Complex floating, de 38 ; structure, de Double-precision complex, de Pointer, de Object 39 ; reference, de Unsigned Integer, de Unsigned Longword Integer, de 40 ; 64-bit Integer, de Unsigned 64-bit Integer 41 ; 42 ; 43 ; 44 ; EXAMPLE: 45 ; 46 ; on cree une structure 30 ; @examples 31 ; We create a structure 47 32 ; IDL> b=get_extra(ok=111, year=[1997,1998,1999], age_capitaine=35) 48 33 ; IDL> help, b,/struct … … 51 36 ; OK INT 111 52 37 ; YEAR INT Array[3] 53 ; on met cette structure sous forme destring38 ; We put this structure as a string 54 39 ; IDL> a=strkeywd(b) 55 40 ; IDL> print, a 56 41 ; AGE_CAPITAINE=35, OK=111, YEAR=[1997,1998,1999] 57 ; maintenant on peut utiliser le string a pour passer des mots cles ds 58 ; une fonction a l''aide de execute!! 42 ; Now we can use the string a to pass keywords in a function thanks to execute!! 59 43 ; IDL> test=execute('c=get_extra('+a+')') 60 44 ; IDL> help, c,/struct … … 64 48 ; YEAR INT Array[3] 65 49 ; 66 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 50 ; @history 51 ; Sebastien Masson (smasson@lodyc.jussieu.fr) 67 52 ; 11/10/1999 53 ; 54 ; @version 55 ; $Id$ 56 ; 68 57 ;- 69 58 ;------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.