Using ITERATE varaible in temp variable name

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Using ITERATE varaible in temp variable name

  • Creator
    Topic
  • #51792
    Steve Drozdowski
    Participant

      Hello, I am just checking to see if this is possible – It doesn’t seem to be working for me, but wanted to make sure I wasn’t missing anything.

      I want to use an ITERATE variable as part of a temp variable name, ex: @myvar_%l1

      So, if I was iterating over a list with elements “1 2 3”, I could reference 3 different temp variables @myvar_1 @myvar_2 and @myvar_3.

      This doesn not seem to do anything – In fact is seems to always generate @myvar_0 ?

      I am running CL 5.6 on AIX 5.3.

      Thanks in advace!

    Viewing 2 reply threads
    • Author
      Replies
      • #71761
        Jim Kosloskey
        Participant

          Steve,

          Hmmm, well I can’t get the Xlate to compile at all using %l1 as you describe.

          Can you share the actual Xlate gui showing what you are attempting?

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

        • #71762
          Steve Drozdowski
          Participant

            Hi Jim, my bad, I can’t get it to compile either…  So, I don’t think it is going to work at all.  I think it would work with FRL or VRL field names, but apparently not with temp variable names.  This would be a very nice feature.  ðŸ™‚

            Thanks anyway.

          • #71763
            Robert Kersemakers
            Participant

              Hi Steve,

              What you could do is use @myvar as a list, like {25 4 31}. Then by iterating over %l1, you can get the corresponding item from the list with

              Code:


              COPY @myvar $%l1 -> @value

              and tclcode

              Code:


              set xlateOutVals [list [lindex [lindex $xlateInVals 0] [lindex $xlateInVals 1]]]

              Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

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