List basis

  • Creator
    Topic
  • #54009
    Mike Keys
    Participant

      Can someone tell me how this works exactly?

      I’ve written out a list of elements to a variable @counter. The list looks something like this {1 2 3 4 5 6 7…etc}

      What I want to do us use this counter as a basis for an interate and then use the variable %l1 to populate an outbound group of XML lines that contain picklist information for an application we are going to use.

      The %l1 variable would indicate which line to write to. So, if the iterate was looking at element ‘2’, then I would be copying data for the second group of picklist lines. Since we can’t iterate on an outbound (WHY????), I’m trying to wrap my head around on how to do this.

      Oh, and I’m going from an HL7 SIU message type to XML, just to keep things interesting. The picklist info is coming from a Tcl proc that grabs data from a database and populates some arrays containing the picklist items info (item_nbr, desc, qty), which is then returned to the XLATE.

      The problem is that if I just do straight copies from these variable, (passed through a pre proc in the copy statement to grab the corresponding array elements for that rep), only the LAST group of data gets copied out. So, I really need some type if iterate.

      We’re using 5.7 Rev2, so I can’t do XLATE chaining. I’m wondering if I should just be looking at writing a separate post proc procedure to fill those lines.

      Oh, second question. Is it possible to take the variable in the basis and use this in the pre proc area? This would be very helpful to me.

    Viewing 2 reply threads
    • Author
      Replies
      • #79864
        Robert Milfajt
        Participant

          Robert Kersemakers outlines the only way I’ve found to iterate over lists in this post:  <a href="https://usspvlclovertch2.infor.com/viewtopic.php?t=2213&#8243; class=”bbcode_url”>https://usspvlclovertch2.infor.com/viewtopic.php?t=2213

          Basically you iterate over a list {0 1} and within the loop work on your list.

          Hope this helps,

          Bob

          Robert Milfajt
          Northwestern Medicine
          Chicago, IL

        • #79865
          Jim Kosloskey
          Participant

            Not that this will help you but in 6.0.0 it is documented you can use temp variables in the basis.

            It is not specific but I suspect that is only the list basis.

            However, it does not work.

            I have a proc which when used with a List ITERATE can get that list for you.

            If you want it email me and I will send it to you.

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

          • #79866
            Robert Kersemakers
            Participant

              I hadn’t seen this post and already answered the same post in de ‘Documentation’.

              So still no iteration with a dynamic basis in version 6. 🙁

              Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

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