Question

Loop in a loop

  • 1 July 2020
  • 1 reply
  • 6 views

Hi,

I designed a process that contains loop in a loop.

I have a problem with iterations. I would like iterations to be numbered continuously and in ascending order.

 

Now the process iterates the loops like this:

 

And I want the algorithm to iterate like this:

 

Outer loop:

Inner loop:

What do I need to change in the algorithm ??


1 reply

Badge +1

Hi!

 

I'm not sure I entirely understand the pictures you've provided, but can you rely on a counter with a global scope instead of ExpressionEvaluators? If the counters have a global scope and the same name, they should work the way you want them to - but I am not sure if the order is guaranteed, that depends if anything is blocking or not.

 

Otherwise, I think you might have some success with the VariableSetter and VariableRetriever. That way, you can guarantee everything to read from the same source, thus having your values count up the way you want. I think the order would be to first fetch the value, then write it back with the fetched value +1.

Reply