1 | |
---|
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
4 | |
---|
5 | <!-- Generated by IDLdoc 2.0 --> |
---|
6 | |
---|
7 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
---|
8 | <head> |
---|
9 | <title>string2struct.pro (SAXO Documentation)</title> |
---|
10 | |
---|
11 | |
---|
12 | <link rel="stylesheet" type="text/css" media="all" href="./../../main_files.css" /> |
---|
13 | <link rel="stylesheet" type="text/css" media="print" href="./../../main_files_print.css" /> |
---|
14 | |
---|
15 | |
---|
16 | <script type="text/javascript"> |
---|
17 | function setTitle() { |
---|
18 | parent.document.title="string2struct.pro (SAXO Documentation)"; |
---|
19 | } |
---|
20 | </script> |
---|
21 | </head> |
---|
22 | |
---|
23 | <body onload="setTitle();"> |
---|
24 | |
---|
25 | <div id="navbar_title"> |
---|
26 | <h1>SAXO Documentation</h1> |
---|
27 | </div> |
---|
28 | |
---|
29 | |
---|
30 | <div id="main_navbar"> |
---|
31 | |
---|
32 | <table cellspacing="0"> |
---|
33 | <tr> |
---|
34 | |
---|
35 | <td><a href="./../../overview.html?format=raw" title="Overview of library">Overview</a></td> |
---|
36 | |
---|
37 | |
---|
38 | |
---|
39 | <td >Directory</td> |
---|
40 | |
---|
41 | |
---|
42 | |
---|
43 | <td><a href="./../../idldoc-categories.html?format=raw" title="Browse library by category">Categories</a></td> |
---|
44 | |
---|
45 | |
---|
46 | |
---|
47 | <td><a href="./../../idldoc-index.html?format=raw" title="Index of files, routines, and parameters">Index</a></td> |
---|
48 | |
---|
49 | |
---|
50 | |
---|
51 | <td><a href="./../../search-page.html?format=raw" title="Search library">Search</a></td> |
---|
52 | |
---|
53 | |
---|
54 | <td id="selected">File</td> |
---|
55 | |
---|
56 | |
---|
57 | <td >Source</td> |
---|
58 | |
---|
59 | |
---|
60 | |
---|
61 | <td><a href="./../../idldoc-help.html?format=raw" title="Help on IDLdoc">Help</a></td> |
---|
62 | |
---|
63 | |
---|
64 | <td >Etc</td> |
---|
65 | |
---|
66 | <td id="flexible">Developer documentation</td> |
---|
67 | </tr> |
---|
68 | </table> |
---|
69 | |
---|
70 | </div> |
---|
71 | |
---|
72 | <div id="secondary_navbar"> |
---|
73 | |
---|
74 | <a href="strcnt.html"><<prev file</a> | <a href="strkeywd.html">next file >></a> <a href="string2struct.html?format=raw" target="_TOP">view single page</a> | <a href="./../../index.html?format=raw" target="_TOP">view frames</a> summary: fields | <a href="#routine_summary">routine</a> details: <a href="#routine_details">routine</a> |
---|
75 | |
---|
76 | </div> |
---|
77 | |
---|
78 | |
---|
79 | <div id="container"> |
---|
80 | |
---|
81 | <h1 class="directory"><a href="directory-overview.html?format=raw">ToBeReviewed/STRING/</a></h1> |
---|
82 | <h2 class="pro_file">string2struct.pro</h2> |
---|
83 | |
---|
84 | <div id="file_attr"> |
---|
85 | <dl> |
---|
86 | </dl> |
---|
87 | </div> |
---|
88 | |
---|
89 | <div id="file_comments"></div> |
---|
90 | |
---|
91 | |
---|
92 | |
---|
93 | |
---|
94 | |
---|
95 | |
---|
96 | |
---|
97 | |
---|
98 | <div id="routine_summary"> |
---|
99 | <h2>Routine summary</h2> |
---|
100 | |
---|
101 | <dl> |
---|
102 | |
---|
103 | <dt><p><a href="#_too_cool"><span class="result">result = </span>too_cool(_extra=<span class="result">_extra</span>)</a></p><dt> |
---|
104 | <dd></dd> |
---|
105 | |
---|
106 | <dt><p><a href="#_string2struct"><span class="result">result = </span>string2struct(<span class="result">strVal</span>)</a></p><dt> |
---|
107 | <dd> NAME: stringToStructure PURPOSE: Takes an input string set up as keywords and returns an anonymous structure.</dd> |
---|
108 | |
---|
109 | </dl> |
---|
110 | </div> |
---|
111 | |
---|
112 | |
---|
113 | <div id="routine_details"> |
---|
114 | |
---|
115 | |
---|
116 | <div class="routine_details" id="_too_cool"> |
---|
117 | |
---|
118 | <h2><a class="top" href="#container">top</a>too_cool </h2> |
---|
119 | |
---|
120 | <p class="header"> |
---|
121 | <span class="result">result = </span>too_cool(<a href="#_too_cool_keyword__extra">_extra</a>=<span class="result">_extra</span>)</p> |
---|
122 | |
---|
123 | <div class="comments"></div> |
---|
124 | |
---|
125 | |
---|
126 | |
---|
127 | |
---|
128 | |
---|
129 | |
---|
130 | |
---|
131 | <h3>Keywords</h3> |
---|
132 | |
---|
133 | <h4 id="_too_cool_keyword__extra">_extra |
---|
134 | |
---|
135 | |
---|
136 | |
---|
137 | |
---|
138 | |
---|
139 | |
---|
140 | |
---|
141 | |
---|
142 | </h4> |
---|
143 | |
---|
144 | <div class="comments"></div> |
---|
145 | |
---|
146 | |
---|
147 | |
---|
148 | |
---|
149 | |
---|
150 | |
---|
151 | |
---|
152 | |
---|
153 | |
---|
154 | |
---|
155 | |
---|
156 | |
---|
157 | |
---|
158 | |
---|
159 | |
---|
160 | |
---|
161 | |
---|
162 | |
---|
163 | |
---|
164 | |
---|
165 | |
---|
166 | |
---|
167 | |
---|
168 | |
---|
169 | |
---|
170 | |
---|
171 | </div> |
---|
172 | |
---|
173 | |
---|
174 | <div class="routine_details" id="_string2struct"> |
---|
175 | |
---|
176 | <h2><a class="top" href="#container">top</a>string2struct </h2> |
---|
177 | |
---|
178 | <p class="header"> |
---|
179 | <span class="result">result = </span>string2struct(<span class="result"><a href="#_string2struct_param_strVal">strVal</a></span>)</p> |
---|
180 | |
---|
181 | <div class="comments"> |
---|
182 | NAME: |
---|
183 | stringToStructure |
---|
184 | |
---|
185 | PURPOSE: |
---|
186 | Takes an input string set up as keywords and returns an anonymous structure. |
---|
187 | This is particularly useful for taking keywords entered by a user in a text |
---|
188 | field and passing then to other routines. |
---|
189 | |
---|
190 | CATEGORY: |
---|
191 | Utility |
---|
192 | |
---|
193 | CALLING SEQUENCE: |
---|
194 | extra=stringToStructure('xrange=[0,10],linestyle=2') |
---|
195 | plot,findgen(100),_extra=extra |
---|
196 | |
---|
197 | INPUTS: |
---|
198 | String set up as keywords. Keywords require a little special treatment. Such as |
---|
199 | plot,findgen(100),_extra=stringToStructure('title="testing"') |
---|
200 | |
---|
201 | KEYWORD PARAMETERS: |
---|
202 | |
---|
203 | None |
---|
204 | |
---|
205 | OUTPUTS: |
---|
206 | This function returns the string as an anonymous structure. If an |
---|
207 | error was found then this function returns a structure with a null field. |
---|
208 | |
---|
209 | COMMON BLOCKS: |
---|
210 | None. |
---|
211 | |
---|
212 | EXAMPLE: |
---|
213 | The code below creates a widget that uses this routine. |
---|
214 | pro tPlot,event |
---|
215 | widget_control,event.top,get_uvalue=field |
---|
216 | widget_control,field,get_value=strVal |
---|
217 | extra = stringToStructure(strVal) |
---|
218 | plot,findgen(100),_extra=extra |
---|
219 | wshow |
---|
220 | return |
---|
221 | end |
---|
222 | |
---|
223 | pro testWid |
---|
224 | ;enter any keyword to plot and see how it works |
---|
225 | base = widget_base(/col) |
---|
226 | field = cw_field(base,title='test',value='ax=0',/string) |
---|
227 | void = widget_button(base,value='plot',event_pro='tPlot') |
---|
228 | widget_control,base,/realize,set_uvalue=field |
---|
229 | xmanager,'testWid',base,/no_block |
---|
230 | return |
---|
231 | end |
---|
232 | |
---|
233 | MODIFICATION HISTORY: |
---|
234 | Written by: |
---|
235 | RLK, Ronn Kling Consulting.</div> |
---|
236 | |
---|
237 | |
---|
238 | |
---|
239 | |
---|
240 | <h3>Parameters</h3> |
---|
241 | |
---|
242 | |
---|
243 | <h4 id="_string2struct_param_strVal">strVal |
---|
244 | |
---|
245 | |
---|
246 | |
---|
247 | |
---|
248 | |
---|
249 | |
---|
250 | |
---|
251 | |
---|
252 | </h4> |
---|
253 | |
---|
254 | <div class="comments"></div> |
---|
255 | |
---|
256 | |
---|
257 | |
---|
258 | |
---|
259 | |
---|
260 | |
---|
261 | |
---|
262 | |
---|
263 | |
---|
264 | |
---|
265 | |
---|
266 | |
---|
267 | |
---|
268 | |
---|
269 | |
---|
270 | |
---|
271 | |
---|
272 | |
---|
273 | |
---|
274 | |
---|
275 | |
---|
276 | |
---|
277 | |
---|
278 | |
---|
279 | |
---|
280 | |
---|
281 | |
---|
282 | |
---|
283 | |
---|
284 | </div> |
---|
285 | |
---|
286 | </div> |
---|
287 | |
---|
288 | |
---|
289 | |
---|
290 | <div id="tagline">Produced by IDLdoc 2.0.</div> |
---|
291 | |
---|
292 | </div> |
---|
293 | |
---|
294 | </body> |
---|
295 | </html> |
---|