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

Home » Public Forums » archive » Re: Append to an array
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Append to an array [message #5455] Thu, 14 December 1995 00:00
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
"Frank J. ?ynes" <frank@spacetec.no> writes:

> khilman@vision.d.umn.edu (Kevin J. Hilman) wrote:
>>
>> Is there an easy way to append an element to a vector, without making
>> a new vector with a bigger size, copying the old vector over and then
>> adding the new element.
>>
>> --
>> Kevin Hilman
>> khilman@d.umn.edu

> Do you mean something like
> ; create vector
> a = findgen(100)
> ; Append an element
> a = [temporary(a), 452]

Although it isn't obvious from the above statements, I believe that Frank
J. ?ynes is correct about what happens internally.

Bill Thompson
Re: Append to an array [message #5460 is a reply to message #5455] Wed, 13 December 1995 00:00 Go to previous message
sjt is currently offline  sjt
Messages: 72
Registered: November 1993
Member
Kevin J. Hilman (khilman@vision.d.umn.edu) wrote:

: Is there an easy way to append an element to a vector, without making
: a new vector with a bigger size, copying the old vector over and then
: adding the new element.

: --
: Kevin Hilman
: khilman@d.umn.edu

vec = [temporary(vec), new_element]

--
+------------------------+---------------------------------- --+---------+
| James Tappin, | School of Physics & Space Research | O__ |
| sjt@star.sr.bham.ac.uk | University of Birmingham | -- \/` |
| Ph: 0121-414-6462. Fax: 0121-414-3722 | |
+----------------------------------------------------------- --+---------+
Re: Append to an array [message #5461 is a reply to message #5460] Wed, 13 December 1995 00:00 Go to previous message
Frank J. �ynes is currently offline  Frank J. �ynes
Messages: 17
Registered: February 1995
Junior Member
khilman@vision.d.umn.edu (Kevin J. Hilman) wrote:
>
> Is there an easy way to append an element to a vector, without making
> a new vector with a bigger size, copying the old vector over and then
> adding the new element.
>
> --
> Kevin Hilman
> khilman@d.umn.edu

Do you mean something like
; create vector
a = findgen(100)
; Append an element
a = [temporary(a), 452]

??
--
/* Frank J. �ynes | frank@spacetec.no /*
/* Spacetec a.s | Phone: +47 77684500 Fax: +47 77655859 /*
/* Prestvannv. 38, | /*
/* N-9005 Troms�, Norway | (...with the bravery of being out of range!) /*
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: SGI RGB image reader would be wonderful.
Next Topic: Need widget help...

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

Current Time: Fri Oct 10 16:04:31 PDT 2025

Total time taken to generate the page: 1.10342 seconds