|
|
Re: Resizing array problem [message #49728 is a reply to message #49727] |
Thu, 10 August 2006 09:17  |
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
|
|
|