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

Home » Public Forums » archive » Re: Dynamically resizing arrays
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: Dynamically resizing arrays [message #42427 is a reply to message #42422] Fri, 04 February 2005 20:04 Go to previous messageGo to previous message
Andrew[2] is currently offline  Andrew[2]
Messages: 7
Registered: February 2005
Junior Member
Hi Jonathan,

Assume you have declared your initial array, lets call it array_init

array_init=INTARR(100) ;for arguments sake

if we now assume that you are in the loop and want to append the new
data, which we also assume is 100 columns long (i.e fixed length)

new_row=intarr(100) ;the array of new data
FOR i=0,99 DO BEGIN
;some operation or whatever you do here
;to place the data in new_row

array_init=[[array_init],[new_row]] ;appened it to the original data
ENDFOR

your array_init will now grow one row at a time with each loop. You
might want to consider using a WHILE statement though to avoid the FOR
loop. I hope this helps, and is correct. Try it with some dummy arrays
(I did).

Cheers
Andrew

Jonathan Greenberg wrote:
> I was hoping to get some feedback on the best way of creating a
"database"
> -- an array of fixed columns but unknown number of rows which will be
> appended to within some sort of loop. What is the best way of doing
this?
>
> --j
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: 3D heart
Next Topic: Blurred display of images in PDFs created from EPS on Mac OS X

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

Current Time: Sun Oct 12 04:57:22 PDT 2025

Total time taken to generate the page: 0.48185 seconds