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

Home » Public Forums » archive » Named and Anonymous structures ?
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: Named and Anonymous structures ? [message #10054 is a reply to message #5121] Sun, 05 October 1997 00:00 Go to previous message
hahn is currently offline  hahn
Messages: 108
Registered: November 1993
Senior Member
On Fri, 6 Oct 1995 17:09:15 GMT, you wrote:

Hi Rob,

If I'm not totally mistaken you could use the procedure
create_struct to nest anonymous structures. This wasn't
possible before IDL 3.6.1 !

Why do you define a structure inside a procedure while it is
returned via the parameter list. Can't you define it before
calling the procedure ? This would allow to use different
code to access fields available in one structure while
skipping the code for a different structure at a different
call. The following worked for me:

pro testit, rqm, s

s.n = 100

print, rqm, s.n, size(s.fx1)

; Note: The variable s.fl1 is only present when rqm=1
;
if rqm eq 1 then print, -1, -1, size(s.fl1)

end
;
s1 = { ABC, n:100L, fx1:LonArr(100) }
s2 = { XYZ, n:100L, fx1:LonArr(100), fl1:fltarr(100) }

a1 = { ABC }
a2 = { XYZ }

testit, 0, a1
testit, 1, a2

end

Maybe I missed the point ...

Hope, this helps
Norbert Hahn
[Message index]
 
Read Message
Read Message
Previous Topic: $$MAKE MONEY FAST$$
Next Topic: Defining structuretype during runtime?? QUESTION!! (no reply)

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

Current Time: Wed Oct 08 19:32:57 PDT 2025

Total time taken to generate the page: 0.00454 seconds