Reference in Xlate to variable that doesn’t exist – not generating error

Clovertech Forums Cloverleaf Reference in Xlate to variable that doesn’t exist – not generating error

  • Creator
    Topic
  • #120799
    Jeff Dinsmore
    Participant

      I mistyped a variable name in an xlate and Cloverleaf doesn’t complain.

      I load a variable (@isAthena) with a boolean flag from a Tcl snippet.

      I then attempt to reference that variable in an if.

      if @isAthen eq =1

      Note that the variable is missing the “a” at the end.

      I’d expect it to throw a “variable doesn’t exist” error or something, but Cloverleaf doesn’t complain at all – it just evaluates it as not true and carries on.

      Is this behavior normal/expected?

       

      Jeff Dinsmore
      Chesapeake Regional Healthcare

    Viewing 3 reply threads
    • Author
      Replies
      • #120800
        James Cobane
        Participant

          As @ variables are dynamic temp variables, I would not expect the engine to complain or throw any warning.  So, I believe this is expected behavior (no error).

          • This reply was modified 1 year, 3 months ago by James Cobane.
          • This reply was modified 1 year, 3 months ago by James Cobane.
        • #120803
          Paul Bishop
          Participant

            What is the “Error:” setting set to on the copy or if command?  If it is set to “Skip”, then you’re correct, it won’t stop with an error.  If it is set to “Error”, you will get a “Fetch failure on ‘<variable name'” error and the process will stop.

            • This reply was modified 1 year, 3 months ago by Paul Bishop.

            Paul Bishop
            Carle Foundation Hospital
            Urbana, IL

          • #120805
            Jeff Dinsmore
            Participant

              Thanks, Paul.  I think that’s the explanation.

              The “if” error handling was set to “skip”.

              Defaulting to “skip” is a little optimistic.  I’m thinking a better, more conservative, default would be “error”.

              Is the default behavior configurable?

              Jeff Dinsmore
              Chesapeake Regional Healthcare

            • #120806
              Jim Kosloskey
              Participant

                Jeff,

                When set to ‘Error’ this is what I see in the testing tool:

                Fetch failure on <name of variable here, sans @>.

                This is one of the reasons I mostly use the temp variable pull down inside the Xlate (non of my keypads function properly :-)).

                I don’t believe the Xlate Error Action default action is configurable.

                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.