|
Post by milfredo on Jun 10, 2020 16:55:38 GMT -5
Here is a piece of code. The first version works fine.
if filedate =Tdate and Right$(f$, 3) = "jcp" then
bob = 22
goto [moveon]
But this version does not work
if filedate =Tdate and Right$(f$, 3) = "jcp" or filedate =Tdate and Right$(f$, 3) = "drf" or filedate =Tdate and Right$(f$, 3) = "mcp" then
bob = 22
goto [moveon]
the Tdate and Right$(f$, 3) = "jcp" is true but for some reason the line of code does not recognize it to be true when the 2nd version is the code.
sure could use some help. Thanks Milfredo
|
|
|
Post by Chris Iverson on Jun 10, 2020 17:32:58 GMT -5
I'm not sure, but I think this might be a problem with order of operations. It evaluates the ANDs and ORs directly, left-to-right, and I think it may not be what you intend.
Try grouping the separate conditions you're testing in parenthesis, with the ORs in parens.
if ((filedate =Tdate and Right$(f$, 3) = "jcp") or (filedate =Tdate and Right$(f$, 3) = "drf") or (filedate =Tdate and Right$(f$, 3) = "mcp")) then
|
|
|
Post by milfredo on Jun 11, 2020 0:27:04 GMT -5
Thank you. I'll give it a shot.
|
|