main:

readadc10 2,b1 'read value on pin 2 into variable b1'

if b1<778 then check1 'if b1 less than 778 then go to check1

if b1,b2,b3,b4 = 3112 then wakeup 'if the sum of variables b1- 'b4 = 3112 then go to wakeup

check1:

pause 500

readadc10 2,b2

if b2<778 then check2

check2:

pause 500

readadc10 2,b3

if b3<778 then check3

check3:

pause 500

readadc10 2,b4

if b4<778 then return

The syntax checker reports an error on the 3rd line in main. I've tried changing this line to read "if b1+b2+b3+b4 = 3112 then wakeup" but the error is still there. Note- wakeup routine not listed

Is it correct to assume rapid readings of the same adc input can be placed in different variables? If, so how can these variables be added?