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

Home » Public Forums » archive » Re: Little CREATE_STRUCT issue
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: Little CREATE_STRUCT issue [message #43226] Thu, 24 March 2005 09:11 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Thu, 24 Mar 2005 13:34:58 +0000, Ricardo Bugalho wrote:

> Hi,
> I want to use CREATE_STRUCT like this:
>
> myStruct = CREATE_STRUCT(['tag1', 'tag2'], [100, 200])
>
> Yes, I have a structure where all elements are of the same type.
> Is there any magic way to do it, or I'll just have to write a small
> function?

You can build it up "piece by piece" using CREATE_STRUCT's ability to
extend structures, like:

myStruct=create_struct('tag1',100)
myStruct=create_struct(myStruct,'tag2',200)
...

which could easily be made into a general function. This is inefficient
for large structures, since it copies and extends the structure once for
each tag, but at least it works.

I suspect RSI decided that if all your values are the same type, you could
just put them in an array and save yourself the trouble of making a
structure out of them... and maybe they have a point.

JD
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: GDL?
Next Topic: Another XML Question

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

Current Time: Sat Oct 11 16:14:24 PDT 2025

Total time taken to generate the page: 0.88364 seconds