comparing value to variable in iterate if statement

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf comparing value to variable in iterate if statement

  • Creator
    Topic
  • #47841
    Jennifer Schlender
    Participant

      Hello–

      I posted a question Friday w/ no answers, but maybe it was just too involved.

      I am trying to compare a varialbe to a value in an if statement inside an iterate. It looks like this:

      1(0).1(0).1(%g1).OBX.00569.[0]   ==  @LAST_SET_ID

      Once the code hits this if, it bombs and doesn’t even go to the else. Any ideas what could be happening?

      Thanks,

      Jennifer

    Viewing 1 reply thread
    • Author
      Replies
      • #56859
        Anonymous
        Participant

          Just a debugging suggestion, you might ‘append before’ a copy action and use the same field as the source.  Then in pre, echo $xlateInVals.  That’ll at least tell you if the path is valid or not.  If it is valid then you might just set another temp field and use that instead of the path in you IF action.

        • #56860
          David Caragay
          Participant

            Jennifer,

            Can you post a little more information on the error you are receiving?  

            As Greg indicated, the problem usually presents itself when you can actually “echo” out the values in question.   What you think is being compared might not be what is actually being processed, something the “echo” would quickly identify.    If you are not familiar with adding “echos” to assist with troubleshooting, it would go something like this:

            1.  Add a copy statement right before the “If” statement.  Copy 1(0).1(0).1(%g1).OBX.00569.[0]  to @my_temp_val.  In the pre tcl box of this copy add       echo >$xlateInVals<   2. In the statement where you created the @LAST_SET_ID temp variable, add     echo >$xlateInVals<     to the pre tcl box. Now when you run the xlate the actual values will be displayed for the two fields in question.  Make sure you see what you expect to see.

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