Another Iter questions

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Another Iter questions

  • Creator
    Topic
  • #49563
    Bob Schmid
    Participant

    I would like to start iterating starting with index one of a repeating field.

    where/how should I init the $f1 variable field ?

Viewing 3 reply threads
  • Author
    Replies
    • #62492
      Jim Kosloskey
      Participant

      Robert,

      You cannot cause the ITERATION Action to begin at any specific point. However, for your case, inside the ITERATE you can modify the %f1 counter. I would rather modify my own counter (say %f2) and use that in the address path of the following Actions. That way you would always be able to tell where the ITERATION was as %f1 would have the real value of the iteration count.

      You can reference and/or modify iteration counters by prefixing the counter with a $.

      Such as a MATH ADD Action where you are trying to add 1 to %f2:

      The Source column would have =1 and $%f2.

      The Destination column would have $%f2.

      You would then use %f2 anywhere appropriate in the Source and/or destination address paths.

      Jim Kosloskey

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #62493
      Chris Williams
      Participant

      If you want to skip given iterations you could take the lines currently inside the iteration and surround them with an IF statement that is only true for those iterations you want to occur.

      ITERATE

         copy …

         copy …

      ETC

      Would become

      ITERATE

         IF %f1 > 0

             copy …

             copy …

      ETC

    • #62494
      Jim Kosloskey
      Participant

      Chris,

      A small but not insignificant change to your IF Action:

      IF $%f1   <---- Note the $   🙂

      So there you have a couple of ways to resolve your issue one where you just use your own counter and start it with one more than the iteration counter, and one where you utilize an IF Action to detect where in the iteration set you are.

      Cloverleaf(R) seems to always provide more than one way to get the job done.

      Jim Kosloskey

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #62495
      Chris Williams
      Participant

      Just wondering if you were paying attention.  ðŸ˜‰

Viewing 3 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,125
Forums
28
Topics
9,294
Replies
34,439
Topic Tags
287
Empty Topic Tags
10