I'm filling an array in a subsequence with an unknown quantity of datas (list of defects).
I update the upper bound of this array each time the operator want to add a new defect.
My issue is that I don't succeed to get this array from the main sequence because I don't know how many elements there are in my array.
Is there a trick to do this ?
(I'm sorry, but i'm not able to share my teststand sequence because of the internal policy of my company)
Thanks a lot in advance,
Solved! Go to Solution.
If I understand correctly your question, than the answer is below:
Locals.A - the array of elements where you want to increment the size.
Locals.NumberOfElements - just a variable where we store the current size, we increase it and than set it back to Locals.A.
Se code below
Locals.NumberOfElements = Locals.A.GetNumElements(),
Thanks for your reply, but I think you misunterstanded my question :
I know how to adjust the size of my array inside the sub sequence, but how can I get this array from the main sequence without knowing in advance how many elements there are?
Here is an exemple of what I want to do :
- In the subsequence, I have an empty array that I'm filling with the quantity of defects the operator found
- In the mainSequence, I want to get back the array to analyze and report it. But I can't set an array because I don't know in advance how many elements there will be in my subSequence "Array" parameter
I hope to be clear enough
If you pass the parameter by reference (and you do according to the screenshot), you don't need to worry to match the size of the array.
The Subsequence will modify automatically the size of the input array.
I have just tested with a simple sequence where I am passing an empty array of strings, in the SubSequence I get the current size and increase it by one.
Calling multiple times the same subsequence, I see my original array (empty created) increased in size.
See the screenshot below.
Oh, I feel ashamed, I would have sworn that we MUST match parameters type/dimensions.
Thanks a lot, and sorry for this uninteresting question.
No worries 😉 Glad that I could help!
You can help other users on the forum so that we keep paying it forward 🙂
Just a TSUser