Iterate List

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Iterate List

  • Creator
    Topic
  • #50618
    Earl Coppedge Jr
    Participant

      I have iterated on fields, groups and segments.  However I am having trouble with iterate on list.

             { { OP ITERATE }

                 { BASIS {0 1 2 3} }

                 { VAR %L1 }

                 { TYPE list }

                 { BODY {

                     { { OP COPY }

                         { ERR 0 }

                         { IN @null }

                         { OUT {{0(0).EVN.#5.[%L1]}} }

                     }

                 }}

      The object is to null out EVN:5.[0] , EVN:5.[1] ,EVN.[2] and EVN.[3].  But when I run it, only EVN:5.[0] gets nulled out.  What am I doing wrong?

    Viewing 2 reply threads
    • Author
      Replies
      • #66808
        Rob Abbott
        Keymaster

          Hmm.  That should work.  Try using lowercase l “%l1” for your variable.

          You could also PATHCOPY @null to 0(0).EVN.#5 if you want to null out all components.

          Rob Abbott
          Cloverleaf Emeritus

        • #66809
          Jim Kosloskey
          Participant

            Eric,

            Try %l1 instead of %L1 (lower case l).

            I have never tried Upper case counter identifiers so I can’t say for sure that is the problem – but it is easy enough to try.

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

          • #66810
            Charlie Bursell
            Participant

              Any % variable should work.  But, it is an iteration variable!  You are attempting to use it to access a subfield.

              Instead of OUT {{0(0).EVN.#5.[%L1]}} try

              OUT {{0(0).EVN.#5(%L1)}}  or

              OUT {{0(0).EVN(%L1).#5}}

              Depending on what you are tring to do

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