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

Home » Public Forums » archive » Re: Resizing array problem
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: Resizing array problem [message #49725] Thu, 10 August 2006 09:24
Tom S. is currently offline  Tom S.
Messages: 9
Registered: June 2006
Junior Member
Thx for the help. :)

Cheers,
Tom
Re: Resizing array problem [message #49727 is a reply to message #49725] Thu, 10 August 2006 09:18 Go to previous message
greg michael is currently offline  greg michael
Messages: 163
Registered: January 2006
Senior Member
You can't resize an array inside a structure - it's fixed. You would
have to keep a pointer to your array in the structure instead.

regards,
Greg
Re: Resizing array problem [message #49728 is a reply to message #49727] Thu, 10 August 2006 09:17 Go to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Thu, 10 Aug 2006, Tom S. wrote:

> Hi All,
>
> I'm having trouble resizing a byte array that's contained within a
> structure. Since I need the array to be larger, I can't use REFORM, and
> since it must become an arbitrary size I can't use REBIN, thus I'm
> trying to use CONGRID.
>
> In my code I have the statements,
>
> HELP, struct.data
> struct.data = CONGRID(struct.data, 512, 512)
>
> Running the program, I get this output in the console:
>
> <Expression> BYTE = Array[512, 300]
> Conflicting data structures: structure tag,<BYTE Array[512, 512]>.
>
> Anyone know how I can get around this?
>
> Thx!!
> Tom

Hi,

you can not change the size of an array inside a structure. I would use a
pointer in the structure:

s={s, p:ptr_new(bytarr(512,300))}
*s.p=congrid(*s.p, 512,512)

regards,
lajos
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: VM command line parameters
Next Topic: Interpolation from irregular to regular grid

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

Current Time: Sat Oct 11 07:24:38 PDT 2025

Total time taken to generate the page: 0.72015 seconds