If then question

Natalie Wilkie

New Member
Can someone please tell me why I am getting a syntax error on this piece of code

if b0 = 0 AND portc pin0 = 1 then jump

Thanks
Natalie

 

inglewoodpete

Senior Member
You can't use decisions spread across more than 1 port in the one statement. Either change your code to 2 lines with 'If' statements (or change your hardware so that the 2 pins are in the same port).

Edited by - inglewoodpete on 02/09/2007 09:42:40
 

Natalie Wilkie

New Member
Thanks, I think this works, or could it be written better?


if b0=0 then
if portc pin0 =1 then
goto jump1

if b0=1 then
if portc pin0 =0 then
goto jump2

endif
endif
endif
endif


Natalie
 

MORA99

Senior Member
That wont work, when the second b0 is inside the first.
<code><pre><font size=2 face='Courier'>
if b0=0 then
if portc pin0 =1 then
goto jump1
endif
else
if portc pin0 =0 then
goto jump2
endif
endif
</font></pre></code>
 
Top