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

Home » Public Forums » archive » Re: resizing an array of structures (uugh)
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: resizing an array of structures (uugh) [message #25228] Mon, 04 June 2001 12:41 Go to previous message
Randall Skelton is currently offline  Randall Skelton
Messages: 169
Registered: October 2000
Senior Member
I have *finally* convinced the department to invest in David's book. It
has only been in the library for 6 hours and it is already out and
reserved for next week :(

Reimar's and David's reply answered my question-- square bracket notation
with a colon for good measure.

IDL> test = {float:0.0, double:0.0, string:''}
IDL> test_arr = replicate(test, 100)
IDL> help, test
TEST STRUCT = -> <Anonymous> Array[1]
IDL> help, test_arr
TEST_ARR STRUCT = -> <Anonymous> Array[100]
IDL> test_arr2 = test_arr[0:50]
IDL> help, test_arr2
TEST_ARR2 STRUCT = -> <Anonymous> Array[51]

This is exactly what I was looking for! Seems the EXTRAC function
would have worked as well.

Using the IDL online help I found 'resize', 'array', 'reform', 'rebin',
'make_array', etc, but I couldn't find any help on doing this rather
simple task. Any thoughts on what I should have searched for?

Thanks again,
Randall

On Mon, 4 Jun 2001, David
Fanning wrote:

> I've read your article several times, and I still can't
> convince myself I'm not missing something. (Is that
> a double negative!?) But I don't see any reason you
> can't treat an array of structures in the same way
> you treat an array of anything. Since you are counting
> the structures as you fill them into the array, don't
> you just want this:
>
> array = array[0:count-1]
>
> Cheers,
>
> David
> --
> 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
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: using SPAWN to work with Windows NT network directories
Next Topic: trouble compiling AIM routines (mac files on windows?)

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

Current Time: Wed Oct 08 15:50:27 PDT 2025

Total time taken to generate the page: 0.00410 seconds