comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Defining structuretype during runtime?? QUESTION!! (no reply)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Defining structuretype during runtime?? QUESTION!! (no reply) [message #5041 is a reply to message #4955] Fri, 08 September 1995 00:00 Go to previous messageGo to previous message
sjt is currently offline  sjt
Messages: 72
Registered: November 1993
Member
Christian Oehreneder (PHOTO-Dissertand) (coehrene) wrote:
: MY PROBLEM AGAIN:

: >Schalom!
: >
: >I want to store variables of different type together in structure. The
: >type of each structure elemet is defined DURING RUNTIME.
: >How can I create a structure, whos tag types and tag number are defined
: >at runtime?
: >
: >Thanks in advance
: > Chris
: >

One way is to use handles. I do this for a structure that has to contain
a variable length array of structures; it's not pretty but it works:

e.g.
pdefs= {graff_define, $
.
.
nsets:0, $
data: handle_create(), $
.
.
}

dtmpl= {graff_data, $
xydata: handle_create(), $
.
.
}

handle_value, dtmpl.xydata, fltarr(2,2), /set
handle_value, pdefs.data, dtmpl, /set, no_copy

When you want to use the data structure, you need to use handle_value to
recover it and then replace it after use (no_copy is a good deal quicker
if you are using the structures a lot and certainly more memory efficient)

--
+------------------------+---------------------------------- --+---------+
| James Tappin, | School of Physics & Space Research | O__ |
| sjt@star.sr.bham.ac.uk | University of Birmingham | -- \/` |
| Ph: 0121-414-6462. Fax: 0121-414-3722 | |
+----------------------------------------------------------- --+---------+
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Named and Anonymous structures ?
Next Topic: wavelet spectra help

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:12:23 PDT 2025

Total time taken to generate the page: 0.00452 seconds