newplumber
Senior Member
Hi every1
I was curious on the If statements like how many times is possible to use "If...and...and...or...and...then"
the reason is because when i using my two switches i used this code
the code will not read pinc.0 = 1 when pinc.0 button is pushed to read high/1
so as always I programmed it wrong and I suppose you can not program it that way
using IF...and...OR...and...then?
So I used this code and broke up the two ANDS which works perfectly
Another simple question is can you use IF..X=X..AND..X=X..AND..X=X..AND..X=X..forever....THEN ?
your friend
I was curious on the If statements like how many times is possible to use "If...and...and...or...and...then"
the reason is because when i using my two switches i used this code
Code:
dirsc = %00000000
Start:
If pinc.1 = 1 and pinc.0 = 0 OR pinc.1 = 0 and pinc.0 = 1 then
sertxd (" one button is pushed ",cr,lf)
elseif pinc.1 = 0 and pinc.0 = 0 then
sertxd (" no button is pushed ",cr,lf)
Endif
Goto start
so as always I programmed it wrong and I suppose you can not program it that way
using IF...and...OR...and...then?
So I used this code and broke up the two ANDS which works perfectly
Code:
dirsc = %00000000
Start:
If pinc.1 = 1 and pinc.0 = 0 then
sertxd (" one button is pushed ",cr,lf)
Elseif pinc.1 = 0 and pinc.0 = 1 then
sertxd (" one button is pushed ",cr,lf)
Elseif pinc.1 = 0 and pinc.0 = 0 then
sertxd (" no button is pushed ",cr,lf)
Endif
Goto start
your friend