Xlate IF Statement

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Xlate IF Statement

  • Creator
    Topic
  • #48027
    Jared Miller
    Participant

      I am trying to accomplish the following in an Xlate:

      If PV1-16 eq KAT THEN

                          PV1-16 -> PV1-16

      ELSE

                          PV2-22 -> PV1-16

      However, I am receiving the following errors when I try this:

      [xpm :xlt :ERR /0:worksite_xlate] Unrecognized field name ‘Can’t locate segment in path.  KAT’

      09/08/2005 14:44:16

      [xpm :xlt :ERR /0:worksite_xlate] IF expression parse failed: Value references must yield exactly one datum

      Error occurred at: ‘T’

      09/08/2005 14:44:16

      [xpm :xlt :ERR /0:worksite_xlate] Unable to compile XLT ‘X_StarLab_HL722_A01.xlt’.

      09/08/2005 14:44:16

      [xlt :xlat:ERR /0:worksite_xlate] [0.0.2132934] Xlate ‘X_StarLab_HL722_A01.xlt’ failed: Unable to load XLT ‘X_StarLab_HL722_A01.xlt’

      Apparently I am adding in the IF statement wrong, but I’m not sure what’s wrong.  Can anyone offer up some assistance?  Thanks.

    Viewing 3 reply threads
    • Author
      Replies
      • #57373
        Ed Mastascusa
        Participant

          Assuming your reference to PV1:16 is correct my guess is that you left out the = in front of ‘KAT’ which would designate it as a string constant.

        • #57374
          Jared Miller
          Participant

            I guess the question is how should the IF statment look??  

            I have – IF 0(0).PV1.00146.[0] eq KAT

            I used the eq because I trying to compare a string and eq is under the string operators list.

          • #57375
            William Rowley
            Participant

              It should look like –

              IF 0(0).PV1.00146.[0] eq =KAT

              Or better yet –

              COPY =KAT -> @tmpkat

              IF 0(0).PV1.00146.[0] eq @tmpkat

            • #57376
              Jared Miller
              Participant

                Thanks a bunch.  I used the temp variable way and it works perfectly.

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