Copy Array to Struct

Noam G.
Carmiel,

Jun 18, 2014
1 Post

0  |  0  

Re: Copy Array to Struct

Hi,
How can i copy array to structure ??
Noam.

Solution Available
DrATEasy (Ron Y.)
Mission Viejo, CA

Jun 18, 2014
367 Posts

1  |  0  

Re: Copy Array to Struct

Use memory copy:for simple types of array (i.e. numeric, type must be identical) or using a variant:

an={1, 2, 3, 4}

MemoryCopy(&stStucture, &anArray)

Or using a Variant data type to perform the copy (this will work for any data type):

vVariant=an
stStructure=vVariant   ! will assign each element in the array to a field in the structure, data type must be compatible

Also the other way around, structure to array

vVariant=stStructure
an=vVariant

Yariv S.
Airport city,

Dec 28, 2020
2 Posts

0  |  0  

Re: Copy Array to Struct

Hi,
How do I get the names of the structure into an array, not their values?
Thanks in advance
YS

Tero S.
Irvine, CA

Dec 28, 2020
16 Posts

0  |  0  

Re: Copy Array to Struct

Hi Yariv,

If you mean the names of struct fields, this is not supported.

Regards,
Tero



Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]