Copy Array to Struct
Noam G.

Jun 18, 2014
1 Post

Copy Array to Struct

How can i copy array to structure ??

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

Jun 18, 2014
288 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):

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


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]