catventure
14-11-2005, 20:49
Hi,
Just checking about this:
Is it valid to do check several conditions inside a single IF/THEN statement like in the below code?
It seems to work logically and does not produce any errors when I alter the contents of variables b and c.....
If so, it's really great we can do things like this. What are the limits to using AND and OR in such situations?
dim b as long
dim c as string
b=34
c="some string"
if (b>0 or b<2) and b<>65 AND b<=34 AND c="some string" _
AND b=34 And c<>"another string" and instr(c,"me")=3 then
msgbox (0,"I am showing because the IF conditions are true")
else
msgbox (0,"I am shown when the IF conditions are false!")
end if
Best wishes,
catventure.
Just checking about this:
Is it valid to do check several conditions inside a single IF/THEN statement like in the below code?
It seems to work logically and does not produce any errors when I alter the contents of variables b and c.....
If so, it's really great we can do things like this. What are the limits to using AND and OR in such situations?
dim b as long
dim c as string
b=34
c="some string"
if (b>0 or b<2) and b<>65 AND b<=34 AND c="some string" _
AND b=34 And c<>"another string" and instr(c,"me")=3 then
msgbox (0,"I am showing because the IF conditions are true")
else
msgbox (0,"I am shown when the IF conditions are false!")
end if
Best wishes,
catventure.