What is wrong with:
let>line1={Upper(%line%)}
MS is reporting a syntax error.
Using the complex expression how do I set out
If>(a=0 or b=0 or C=0) and d>0
Complex expressions
Moderators: JRL, Dorian (MJT support)
What is wrong with:
let>line1={Upper(%line%)}
MS is reporting a syntax error.
Nothing wrong with the expression. You will get the syntax error if "line" has no value.
Try this in the editor using the debugger, set different values for a, b, c, d .Using the complex expression how do I set out
If>(a=0 or b=0 or C=0) and d>0
Let>a=1
Let>b=1
Let>c=0
Let>d=0
If>{(%a%=0) or (%b%=0) or (%c%=0) and (%d%>0)}
MDL>Conditions were met.
Else
MDL>Conditions were not met
EndIF
Hope this helps,
Dick
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
will give a syntax error if %line% has not been declared yet.let>line1={Upper(%line%)}
The following works OK:
Code: Select all
Let>line=abcde
let>line1={Upper(%line%)}
From the Help section on "IF",
and from the paragraph dealing with complex expressions you wil find:Variables must be delimited with % symbols
Again, as noted above, this will only work after you have declared the variables, so, for your example, you must have://complex expression:
IF>{(%a% = 5) AND (%VarA% = "allen")}
//do something
ELSE
//do something else
ENDIF
Code: Select all
Let>a=0
Let>b=0
Let>c=0
Lett>d=5
IF>{((%a% = 0) OR (%b%=0) OR (%c%=0)) AND (%d%>0)}
//do something
ELSE
//do something else
ENDIF
Note after posting:
I see that JRL was a bit quicker than me with a solution. Remarkable how similar they both are

Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!