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

Home » Public Forums » archive » Re: allocating data to different array on each loop step
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: allocating data to different array on each loop step [message #46267 is a reply to message #46262] Sat, 12 November 2005 08:25 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
snfinder@naver.com writes:

> Tha data in loop is also array not a single value
> Therefore I will have several arrays after loop operation.

I would do something like this:

arrays = PtrArr(24)
FOR j=0,23 DO BEGIN
...calculation to obtain array of whatever size
arrays[j] = Ptr_New(thisLoopArray, /No_Copy)
ENDFOR

Now you have a pointer array. Each element in the array
is a pointer to another array of variable length.

array1 = *arrays[0]
array2 = *arrays[1]
...
array24 = *arrays[23]

Be sure to free your pointers when you are done with them:

Ptr_Free, arrays

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Access to title object in IDLgrAxis
Next Topic: subscripting arrays with dim > 1

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

Current Time: Wed Oct 08 22:29:23 PDT 2025

Total time taken to generate the page: 1.19821 seconds