[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with ASSOC,/PACKED


I wrote yesterday:

> Brian Jackel (bjackel@phys.ucalgary.ca) writes:
> > I've run across a bug(?) using ASSOC,/PACKED 
> > This appears under v5.3 for Win9x, and v5.2 on
> > SGIs.  
> > 
> > If anyone has spare time, could you look
> > at the following demonstration script to see if
> > I'm doing anything obviously wrong.  Tests
> > on other architectures or versions would also
> > be welcome.
> This is the first time I've run across this new
> PACKED keyword, so I really couldn't tell you
> how it works. But on the face of it (and given
> 12+ years reading IDL documentation) this appears
> to be an unfortunate explanation in the documentation.
> I don't have much to go on except a little voice in
> my head that goes, "Naaah, that's not how it works." 

Well, my explanation sounded good, but was the
usual nonsense, according to the people who really
know how this works. 

It turns out this is a bug in IDL that shows up
when you have structure fields in structures.
The ASSOC function counts the structure as "1",
instead of the number of actual elements in the
sub-structure. The fix has already been placed
in the IDL 5.4 code.

Sorry for any confusion. And my sincerest apologies
to any technical writers whose feelings I may have
bruised. :-)



David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155