AnsweredAssumed Answered

How to, generate an array from a .NET structure?

Question asked by sigiK on Oct 17, 2012
Hi all,

I have to use a .NET assembly in VEE 9.2.
There are some fixed structures we have to work with. We can declare the structure variables, that works with the .NET API calls.

Now, we need a ARRAY of one of this fixed API structures. How can I generate an ARRAY with a given structure?

What I have done:
Declaration of the structure variable via .NET call: SessonContextStruct
Now, I can work with this, writing and reading items.
Example:
SessonContextStruct.partNumber ="33.0815.123";
SessonContextStruct.parentPartNumber = "MyParentPartNumber";

I need this structure now in a array, to can work with the array as e.g.:
SessonContextStruct[0].partNumber ="33.0815.123";
SessonContextStruct[0].parentPartNumber = " MyParentPartNumber ";
SessonContextStruct[1].partNumber ="10.0815.999";
SessonContextStruct[1].parentPartNumber = " MyNextParentPartNumber ";

How can I generate a array-structure?

=========================
Problem solved:

With .NET SYSTEM.ARRAY I can create at first the Type of the API structure with:
array.GetType() the I create an array with:
Array.CreateInstance( returnValueOf_array.GetType(),length)

More details of this problem, look at the German VEE board:
Link: [http://www.veeforum.de/array-eines-net-objects-struktur-erzeugen-t-378.html]

Thanks, Sigi

Edited by: sigiK on Oct 19, 2012 5:12 PM

Edited by: sigiK on Oct 19, 2012 5:30 PM  

Outcomes