Re: creating a special kind of array [message #9982] |
Wed, 01 October 1997 00:00 |
wonko
Messages: 22 Registered: March 1997
|
Junior Member |
|
|
slameczka@biomech.mat.ethz.ch (Michael Slameczka) wrote:
> i hope that the problem i have is very simple, but i found till now
> no solution, which satisfies me.
>
> I have a structure and i will build an array like this:
>
> array = [['name_1',struct_1],['name_2',struct_2],['name_3',struct_3] ]
Do you mean this?
array(0,0) eq 'name_1'
array(1,0) eq struct_1
> struct_x = {, name:string(10), data:intarr(4)}
> (where x is 1, 2, 3)
> is it in any way possible to build such an array in PV-Wave or not?
Not possible, the entries of an array all have to be of the same type.
What about something like this?:
a_struct = { name:'', struct:struct_x }
array = [ a_struct, a_struct, a_struct ]
or better: array = replicate( a_struct, 3 )
a_struct(0).name = 'name_1'
a_struct(0).struct = struct_1
Or this:
name_array = [ 'name_1', 'name_2', 'name_3' ]
struct_array = [ struct_1, struct_2, struct_3 ]
Alex
--
Alex Schuster Wonko@weird.cologne.de PGP Key available
alex@pet.mpin-koeln.mpg.de
|
|
|
Re: creating a special kind of array [message #9984 is a reply to message #9982] |
Wed, 01 October 1997 00:00  |
R. Bauer
Messages: 137 Registered: November 1996
|
Senior Member |
|
|
Michael Slameczka wrote:
>
> hello folks;
>
> i hope that the problem i have is very simple, but i found till now
> no solution, which satisfies me.
>
> I have a structure and i will build an array like this:
>
> array = [['name_1',struct_1],['name_2',struct_2],['name_3',struct_3] ]
>
> the structures are looking like this:
>
> struct_x = {, name:string(10), data:intarr(4)}
> (where x is 1, 2, 3)
>
> is it in any way possible to build such an array in PV-Wave or not?
>
on idl I do it whith new_struct=[struct_1,struct_2,struct_3]
> thanks in advance
> michael
> ____________________________________________________________ ______
> Michael Slameczka
> Biomechanics Laboratory, ETH Zurich
> Wagistrasse 4
> CH-8952 Schlieren
> Switzerland
> Phone: +41 1 633 63 58
> Fax: +41 1 633 11 24
> E-mail: slameczka@biomech.mat.ethz.ch
--
R.Bauer
Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
|
|
|