PDA

View Full Version : Array in a unnamed structure



buzzkaido
04-20-2010, 07:31 AM
Hello,

I'm using unnamed structures in PV-Wave to store some values, for example :



myStruct={, $
x : LONG(0), $
y : LONG(0), $
buffer : lonarr(64, 64) $
}


This structure is "global" and many functions access it to read or update the values.

I would like to do something like :


myStruct.buffer = lonarr(128, 128)

But it gives me a PV-Wave error.

Is there any way to modify the "buffer" array dimensions ?

Thanks.

donb
04-20-2010, 07:54 AM
Hello Buzzkaido,

The simple answer to your question is no - from the PV-WAVE documentation under 'Working with Structures':
Just as you cannot alter the basic definition of an integer or floating-point data type in PV-WAVE, you cannot alter a structure definition after it has been created.

Structures are used to define a new data type or structure in PV-WAVE, and once defined can not be changed (except they can be delete or created on the fly).

However, you can use LISTS and Associated Arrays which are both very dynamic data types.

Cheers, Don B.

buzzkaido
04-20-2010, 08:43 AM
Thanks.

But this structure is also used as a parameter in a C++ DLL call (using LINKNLOAD)

I have the same structure definition in my .h C++ file (using a pointer for the array adress).

Can I use a List or an Associated Array in the same (very simple) way ?