DECLARING/SETTING VARIABLE IN TRANSLATION

Clovertech Forums Cloverleaf DECLARING/SETTING VARIABLE IN TRANSLATION

  • Creator
    Topic
  • #115578
    Stewart
    Participant

      I need to check multiple repeating fields/segments for a value.  If the value exists in any these segments I need to send the message on, otherwise I need to stop/kill it.  Is it possible to declare a variable, set the variable and then perform an if on the now set variable?

    Viewing 1 reply thread
    • Author
      Replies
      • #115579
        Rob Abbott
        Keymaster

          yes.

           

          copy =value –> @varname

          copy =0 –> @value_exists

           

          inside your iterate,

          if path eq @varname

          copy =1 –> @value_exists

           

          after your iterate,

          if @value_exists eq =0

          SUPPRESS

          Rob Abbott
          Cloverleaf Emeritus

        • #115584
          Jim Kosloskey
          Participant

            Another way:

            SUPPRESSS Action at the beginning of your Xlate followed by the ITERATE.

            Inside the ITERATE do the test. If true, build your outbound message then issue a CONTINUE Action (to cut the message) and BREAK Action to get out of the ITERATE else just issue a BREAK Action.

            Given the stated situation I don’t think you need a variable.

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

        Viewing 1 reply thread
        • You must be logged in to reply to this topic.