How many AND / OR are accepted ?
good day ,
I have a very simple qestion regarding the number of AND and OR can be put in the " if " control under PicbasicPro.
Eg.: if (a>b) AND (c>d ) AND (e>f) AND (g>h) AND (i>l ) AND ( m>n) AND (o>p) THEN ....
How many AND / OR are accepted ?
Thanks
Ambro
Re: How many AND / OR are accepted ?
I think that the number of Logic are limited by the two line space!
But you can do the and Logic with nested if/then like this:
If a>B then
If c>d then
If e>F then
.
.
If x>z then
Code for the Action necessary If all the ands are satisfied
ENDIF
.
.
ENDIF
ENDIF
ENDIF
This type of construct is shorter in terms of ram usage and is much faster than the corresponding "line construct"
With the same approch you can make the OR construct.
Naturaly here the limitation is the ram size of your mcu.
Cheers
Al.
Re: How many AND / OR are accepted ?
Thanks for the clarification,
All the best.
Ambro