Iterations with lists

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Iterations with lists

  • Creator
    Topic
  • #47775
    Anonymous
    Participant

      Trying to set up an iteration using the list type, and I’m having some problems.  I am defining the list in a @ variable, but I think that’s where I’m not succeeding.

      I’ve tried Concat’ing

      =1

      =2

      and

      =1 2

      and

      ={1} {2}

      and every other conbination I can think of, without success.  Can anyone give me some direction, please?  Thanks

      Matt

    Viewing 7 reply threads
    • Author
      Replies
      • #56686
        Mark Thompson
        Participant

          Just use

          1 2

          for the list basis.

          - Mark Thompson
          HealthPartners

        • #56687
          Anonymous
          Participant

            What if I want to use a variable as the list basis?  Can I do that?

            I want to base how many iterations to do on an inbound field.  For example, if Hospital Service is a therapy, I only want to iterate once.  But if Hospital Service indicates a multiple therapy, I want to iterate x number of times.  Thanks again

          • #56688
            Jim Kosloskey
            Participant

              This has been requested for an enhancement.

              My feeling is you should be able to point to a temp variable or even an inbound or outbound field as the source for the list.

              As it is, the list function is too constraining. I rarely hve a use outside of generating test data for the list iterate because of its fixed nature.

              I would have had a few rather neat uses if it were more flexible.

              Jim Kosloskey

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

            • #56689
              Anonymous
              Participant

                Thanks Jim,

                That was exactly what I was trying to do.  I will try to find a work around.

              • #56690
                James Cobane
                Participant

                  I believe you should be able to reference/manipulate the list iteration variable (%l1), the same as you can access the group,segment, field iteration variables by using the $ sign prefix (i.e. $%l1).

                  Jim Cobane

                  PHNS, Inc.

                • #56691
                  Anonymous
                  Participant

                    Thanks Jim, and that’s what I’m doing.

                    I have a “Maximum” number of iterations, so I set the iterate to that, then I’m checking the $%l1 to a counter temp variable.  That’s getting done what I needed.

                    Now all I have to do is get that darn SEND working.

                    Thanks again everyone.

                  • #56692
                    Anonymous
                    Participant

                      Just to add my two cents, the list basis is really just a place holder.  You only get the index variable to work with but you can’t access the basis and use it.  When I do lists I always make my basis start with zero (0 1) so that I don’t get confused.

                    • #56693
                      Anonymous
                      Participant

                        Thanks.

                        I do think it would be helpful to be able to use a temp variable as the basis.

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