Using the IF Statement

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Using the IF Statement

  • Creator
    Topic
  • #48160
    Mary Jayne Gould
    Participant

      I am a beginner user of the Cloverleaf application. I am trying to use the IF statement and use string values with embedded spaces in the comparisons of the condition. Here’s my example:

      1(%g1).ORC.00221.[6] eq =Discharge Today || 1(%g1).ORC.00221.[6] eq =Discharge Tomorrow || 1(%g1).ORC.00221.[6] eq =Timed(Sweep Time)

      I’ve tried quotes, braces, parentheses to surround the values, but I keep getting errors in the testing tool.

      Any suggestions?

      Thanks…Mary Jayne

    Viewing 0 reply threads
    • Author
      Replies
      • #57874
        Jim Kosloskey
        Participant

          Mary,

          A couple of suggestions:

          Some people have reported success by first copying the literals to a temporary variable and then doing the IF Action against the temprorary variable(s).

          Another option might be to place the string entries in a Table where the default is N and you equate each literal with the value Y.

          Then in the Xlate do a Table Lookup using the ORC.00221 field and place the output from the lookup in a temporary variable. Then IF the Temporary variable equal to Y do whatever you would do if the string matched.

          Jim Kosloskey

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

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