- Timestamp:
- 07/21/06 14:47:49 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Documentation/idldoc_html_output/ToBeReviewed/STRING/strkeywd.html
r138 r142 696 696 </div> 697 697 698 <div id="file_comments"></div> 698 <div id="file_comments"> 699 Translate a sturcture in a string able to be used to specify keywords 700 in the calling of a function when we use EXECUTE (see example) 701 </div> 699 702 700 703 … … 711 714 <div class="routine_details" id="_strkeywd"> 712 715 713 <h2><a class="top" href="#container">top</a>strkeywd </h2> 716 <h2><a class="top" href="#container">top</a>strkeywd <span class="categories"> 717 </span></h2> 714 718 715 719 <p class="header"> … … 717 721 718 722 <div class="comments"> 719 NAME: strkeywd (string keywords) 720 721 PURPOSE: traduit une sturcture en un string pouvant etre utilise 722 pour specifier des keywords ds l''appelle d''une fonction qd on 723 utilise execute (cf l''exemple) 724 725 CATEGORY: pour passer des mots cles avec execute ! 726 727 CALLING SEQUENCE:res=strkeywd(struct) 728 729 INPUTS:struct: une structure 730 731 KEYWORD PARAMETERS: 732 733 OUTPUTS:un string compose de la facon suivante: 734 pour chaque element de la structure, on ecrit une partie du 735 string sous la forme: 736 'nom_de_l''element=contennu de l''element' 737 738 COMMON BLOCKS: 739 740 SIDE EFFECTS: 741 742 Si un element de la structure contient un tableau, il sera 743 convertit en vecteur. 744 745 RESTRICTIONS: 746 747 attention cette fonction comporte des boucles, des if et des cases 748 ds tous les sens. Elle ne doit donc pas etre utilisee avec des 749 structure de grosse taille (avec bcp d''elements et avec des 750 elements etant de gros tableaux). 751 la structure en entree ne doit pas contenir de Complex floating, de 752 structure, de Double-precision complex, de Pointer, de Object 753 reference, de Unsigned Integer, de Unsigned Longword Integer, de 754 64-bit Integer, de Unsigned 64-bit Integer 755 756 757 758 EXAMPLE: 759 760 on cree une structure 761 IDL> b=get_extra(ok=111, year=[1997,1998,1999], age_capitaine=35) 762 IDL> help, b,/struct 763 ** Structure <817f4bc>, 3 tags, length=10, refs=1: 764 AGE_CAPITAINE INT 35 765 OK INT 111 766 YEAR INT Array[3] 767 on met cette structure sous forme de string 768 IDL> a=strkeywd(b) 769 IDL> print, a 770 AGE_CAPITAINE=35, OK=111, YEAR=[1997,1998,1999] 771 maintenant on peut utiliser le string a pour passer des mots cles ds 772 une fonction a l''aide de execute!! 773 IDL> test=execute('c=get_extra('+a+')') 774 IDL> help, c,/struct 775 ** Structure <817f2dc>, 3 tags, length=10, refs=1: 776 AGE_CAPITAINE INT 35 777 OK INT 111 778 YEAR INT Array[3] 779 </div> 780 781 723 </div> 724 725 <h3>Return value</h3><div class="preformat"> 726 a string composed like following: 727 For each element of the structure, we write a part of the string as: 728 'name_of_the_element=content_of_the_element' 729 </div> 782 730 783 731 … … 796 744 </h4> 797 745 798 <div class="comments"></div> 746 <div class="comments"> 747 a structure 748 </div> 799 749 800 750 … … 803 753 804 754 805 806 807 808 809 810 811 812 813 814 815 816 755 <h3>Examples</h3><div class="preformat"> 756 We create a structure 757 IDL> b=get_extra(ok=111, year=[1997,1998,1999], age_capitaine=35) 758 IDL> help, b,/struct 759 ** Structure <817f4bc>, 3 tags, length=10, refs=1: 760 AGE_CAPITAINE INT 35 761 OK INT 111 762 YEAR INT Array[3] 763 We put this structure as a string 764 IDL> a=strkeywd(b) 765 IDL> print, a 766 AGE_CAPITAINE=35, OK=111, YEAR=[1997,1998,1999] 767 Now we can use the string a to pass keywords in a function thanks to execute!! 768 IDL> test=execute('c=get_extra('+a+')') 769 IDL> help, c,/struct 770 ** Structure <817f2dc>, 3 tags, length=10, refs=1: 771 AGE_CAPITAINE INT 35 772 OK INT 111 773 YEAR INT Array[3] 774 </div> 775 <h3>Version history</h3> 776 777 <h4>Version</h4><div class="preformat"> 778 $Id$ 779 </div> 780 <h4>History</h4><div class="preformat"></div> 781 782 783 <h3>Known issues</h3> 784 785 786 787 <h4>Restrictions</h4><div class="preformat"> 788 If an element of the structure contain an array, it will be convert in a vector. 789 790 791 Beware, this function has loops, ifs ad cases everywhere. So it can 792 not be used by big keywords (with a lot of elements which are big 793 arrays). The input keyword must not contain Complex floatings, structure, 794 Double-precision complex, Pointer, Object reference, Unsigned Integer, 795 Unsigned Longword Integer, 64-bit Integer or Unsigned 64-bit Integer. 796 </div> 817 797 818 798
Note: See TracChangeset
for help on using the changeset viewer.