Pass variable to Iteration

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Pass variable to Iteration

  • Creator
    Topic
  • #49446
    Austin Adams
    Participant

      I have an OBX iteration that I need to pass in a variable on the nth iteration within an IF statement.

      (assuming that all other variables have been declared):

      I have a variable that keeps the value of %g2 and some other code that checks other fields for a string match.  When a match occurs, I need the value of %g2 because I will use it to change a particular OBX field (in my cause OBX14) on “that” iteration.

      Is it possible to pass in a variable in an iteration and how? I’ve tried the line below but it didn’t seem to help.

      1(0).1(0).1(@lastOBX).OBX(0).00573(0).[0].[0]

      FOR TESTING, I can hard code the value of @lastOBX and the field within the message will change.

      1(0).1(0).1(HardCodedValueHere).OBX(0).00573(0).[0].[0]

      Summary –

      What am I trying to accomplish?

      Answer:   Change OBX14 on the very last iteration

      Thanks for any help,

      Austin

    Viewing 1 reply thread
    • Author
      Replies
      • #62001
        Tom Rioux
        Participant

          Try moving the value of %g2 (which I assume you are using in the iterate) to a variable that you know won’t be used by an iterate

          For example:   IN  $%g2  —->  $%g4

          Then use the %g4 variable when you are ready for the move:

          1(0).1(0).1(%g4).OBX(0).00573(0).[0].[0]

          I’m on 5.2 and this works in the tester.  Let me know if it works for you.

          Thanks…

          Tom Rioux

          Baylor Health Care

        • #62002
          Austin Adams
          Participant

            It worked like I wanted it to.  Thank you for the help.  I am sure that other people will find your answer helpful as well.  

            Austin

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