02-25-2014 03:19 AM
Hi,
I have a sequence that aims to do the same job for one or several same elements typed. eg:
______________
subsequenceA :
foreach element in (all elements array)
//do the job
endfor
______________
now in my caller I would like to call subsequenceA in several ways :
subsequenceA(firstElement)
subsequenceA(firstElement, secondElement)
subsequenceA(firstElement, secondElement, .... , lastElement)
Is it possible ?
Another question : is it possible to do a call of subsequence in a pre-expression ?
Solved! Go to Solution.
02-25-2014 03:38 AM
No, calling subsequences can only be done using the SequenceCall step. At least, it is not easy doing it another way (as it requires quite some knowledge of the TS API).
Why don't you pass the array "as is".... (array parameter)?
Norbert
02-25-2014 03:50 AM - edited 02-25-2014 04:03 AM
Because sometime I have to pass two strings and other time five strings to my subsequence.
Any idea ?
02-25-2014 04:22 AM
Yes, build an array of strings and pass them as string-array. Maybe you want to add a numeric parameter "array size", but that is optional as the subsequence can easily get that information from the array itself.
Norbert
PS: Don't mark an answer as solution as long as you have questions left on that topic.
02-25-2014 04:24 AM
Taking Norberts Idea forward you can create a container.
parameter_container having array of strings and no of characters filled.
In your calling sequence you send fill no of arrays required.Fill the no of strings also.
In your called sequence loop the array for no of strings.
Hope this helps.