Copy Array to Struct
Noam G.
Carmiel,

Jun 18, 2014
1 Post

Copy Array to Struct

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

Solution Available
DrATEasy (Ron Y.)
Mission Viejo,

Jun 18, 2014
235 Posts

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



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]