Announcement

Collapse
No announcement yet.

Expression seems valid but errors in log - "ERROR mismatched input"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Expression seems valid but errors in log - "ERROR mismatched input"

    I'm trying to use the following expression in an event trigger:
    Code:
    ($NEWVALUE = 1 Or $NEWVALUE = 9) And ($OLDVALUE <> 1 And $OLDVALUE <> 9)
    I'm fairly certain the expression is valid syntax, but EasyTrigger doesn't like it and is generating the following error in the log each time the event trigger is evaluated:
    Code:
    Jun-04 5:40:00 PM EasyTrigger ERROR mismatched input 'Or' expecting ')' at line 1:7 missing EOF at ')' at line 1:15
    Jun-04 5:40:00 PM EasyTrigger ERROR mismatched input 'And' expecting ')' at line 1:8 missing EOF at ')' at line 1:18

    Any ideas why ET doesn't like the expression?


    Click image for larger version

Name:	Screenshot 2020-06-04 17.33.37.png
Views:	53
Size:	17.2 KB
ID:	1391343

    #2
    Well it looks like EasyTrigger doesn't like the VB style logical operators ("And" and "Or"). The documentation here says it is valid, and I'm fairly certain I have used them before in EasyTrigger expressions, so I'm not sure why this one is throwing errors. Maybe spud can shed some light?

    Anyway, the errors are gone after changing to the C style logical operators:
    Code:
    ($NEWVALUE = 1 || $NEWVALUE = 9) && ($OLDVALUE <> 1  && $OLDVALUE <> 9)
    Seems wrong to use mixed style operators, so for consistency sake, I guess I will switch to using all C style operators in ET expressions:
    Code:
    ($NEWVALUE == 1 || $NEWVALUE == 9) && ($OLDVALUE != 1 && $OLDVALUE != 9)

    Comment

    Working...
    X