Escaping a question mark inside a translation

Clovertech Forums Cloverleaf Escaping a question mark inside a translation

  • Creator
    Topic
  • #118947
    mark boomaars
    Participant

      In an xlate I need to be able to evaluate (IF) whether a string contains some substring. In this case I want to find out if a TXT segment of an EDI message contains the string “Document type?”

      0(0).TXT(%g2).#1(0).[0] ct =Document type?

      However, when I run it through the test tool, I get an error message:

      “[0:TEST] IF expression parse failed: Unrecognizable lexical token
      Error occurred at: ‘?’ ”

      How can I escape that question mark ?

      Cheers,

      Mark

    Viewing 3 reply threads
    • Author
      Replies
      • #118951
        Jim Kosloskey
        Participant

          2 thoughts come to mind:

          1 try =Document type\?

          2 try COPY =Document type? to a temp variable then use the temp variable in your IF Action.

           

          What release of cloverleaf?

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

        • #118952
          mark boomaars
          Participant

            Hello Jim,

            Thanks for your response. We use Cloverleaf 6.2

            First option:

            I tried the \?

            It resulted in the following error:

            “[0:TEST] IF expression parse failed: Unrecognizable lexical token
            Error occurred at: ‘\?'”

            Second option:

            0(0).TXT(%g2).#1(0).[0] ct =@docType

            Also results in an error:

            “[0:TEST] IF expression parse failed: Extra characters after expression
            Error occurred at: ‘e'”

            Am I doing something wrong in the second option?

            Cheers,

            Mark

          • #118955
            Jim Kosloskey
            Participant

              On the second option do not use the =

              0(0).TXT(%g2).#1(0).[0] ct @docType

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

              • #118956
                mark boomaars
                Participant

                  Yes! That works perfectly.

                  Thanks a lot…

              • #118957
                Jim Kosloskey
                Participant

                  You are welcome.

                  Now please report this to INFOR Support. I think this is a bug. I cannot think of any reason a ? should have caused the issue you experienced.

                  Perhaps there is a patch addressing this for 6.2 or it is fixed in 19.x or 20.x – or – this has never been reported and a patch can be constructed – or – this is not a bug.

                  In any case, I think INFOR needs to be aware.

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

              Viewing 3 reply threads
              • You must be logged in to reply to this topic.