Iteration of a list, does not progress past two list items

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Iteration of a list, does not progress past two list items

  • Creator
    Topic
  • #54228
    Jerry Schnecker
    Participant

      I have a flat file delimited by n. I split the file into its items, which places each item within {item}. There are 17 items in the sample I am working with. This is the code that I am using, found this on Clovertech, thanks guys.

      I have tried many different ideas drawing from the resources here. At this point I can only get two items from the list. If I change the basis to “{0 1}” then I only get one item. The %l50 interation is reset to 0 after each cycle. Any help would be much appreciated.

      The @OBX5LIST contains the data and @COUNT contains the number of items on the list.

      { { OP ITERATE }

    Viewing 1 reply thread
    • Author
      Replies
      • #80649
        Jim Kosloskey
        Participant

          Jerry,

          The LIST ITERATE iterates over the basis (that is the list it is iterating over) not any data.

          I suspect your temp variable is a list.

          So you can use the List ITERATE but you will need to pop off each element in the list inside the ITERATE this will require Tcl – I have a proc that does that. The as long as what is popped off is not null set the List ITERATE Counter (%l50 in your case) to zero otherwise set it to 2 (assumes a basis of ‘0 1’).

          If you like you can email me and I will work with you on this off-line.

          email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

        • #80650
          Robert Milfajt
          Participant

            I suspect the problem is with your BASIS in the list ITERATE.  I believe (and looking at some of my own Xlates using this method), it should read:

            Code:

                   { { OP ITERATE }
                       { BASIS {0 1} }

            Hope this helps,

            Robert Milfajt
            Northwestern Medicine
            Chicago, IL

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