Quote:
if (p1_y > 135) then skip:
skip:
relay1_fwd = 1
|
In PBasic 1.33 and earlier, if-then branching works like this: if the condition is true, then execution continues at the label following "then"; if it is false, then execution continues at the next statement. In your statement, the label "skip:" comes immediately after the if statement, so it is executed in both cases. Here's what it should look like:
if (p1_y > 135) then skip:
relay1_fwd = 0 &n bsp; 'the "else" case
goto endif: &n bsp;'without this, execution would just continue at the next line, "skip"
skip:
relay1_fwd = 1 &n bsp; 'the "then" case
endif: