10-13-2009 05:40 AM
I have created an Array of Conatiner in Local variable (say Locals.Array_C). Within Array_C, I have few containers like Cont_1, Cont_2, Cont_3.
Lets consider that there are four(4) Number fields added in the Cont_2.
Here the number of elements in the Cont_2 is 4, but if I want to read this size through TestStand, how can I do that?
I also tried to use "Call PropertyObject.GetNumElements" ActiveX property, but I could not get how to set Object Refernce in this case.
Please help.
Solved! Go to Solution.
10-13-2009 08:11 AM
Hi niru,
Note: A Container is not an array. So GetNumElements is not working on Cont_2. Because it is a container.
To determine the "Number of Elements" you have to use GetNumSubProperties.
If ALL elements in your Array_C AND in your Container_1,2,3,4 have the SAME type e.g. a number
you could place an array to the Array_C
Hope this helps
juergen
10-13-2009 09:46 AM
Thank you for replying back.
In my actual sequence file, there is possibilty that are not SAME. Hence I will stick to GetNumSubProperties.
I tried using it, it asks for "Lookup string" as input. Can you please let me know what should be the proper string value to be entered, if we consider above attached example? How can I get the value 4 as output, for Array_C.1.Cont_2 using GetNumSubProperties?
Regards,
Niraj.
10-13-2009 09:56 AM
10-13-2009 02:12 PM
Hi,
Your problem is how you are specify the array part. It may also be what you are using as the reference.
Lets look ate the array part using the SequenceContext as the reference. The lookup string will be:
"Locals.Array_C[1].Cont_2.Elemen4"
If you are using the Locals as the reference the lookup string will be:
"Array_C[1].Cont_2.Element4"
Hope this helps
Regards
Ray Farmer
10-14-2009 02:53 AM
Thank you Ray,
The issue is resolved.
10-15-2009 03:33 PM
niru -
I believe the lookup string you would pass to GetNumSubProperties would be "Locals.Array_C[1].Cont_2" if you're using the Sequence Context as a reference. If you were using Locals as a reference, it would be "Array_C[1].Cont_2".
Hope this helps!