Thanks a lot, I've fixed it now. But I think there's a flaw in compiler. Any normal compiler, when see "RETURN" command without GOSUB, should pop up an error "RETURN without GOSUB"
I have another question. From PBP examples, I've learned how to interact with multiple buttons. But how to set "action" running only when button is being pressed and hold?
This is an example code:
here the TOGGLE command toggles the status of the led. So instead of toggle, I can use HIGH LED1, HIGH LED2? but what will make LEDs low, when buttons aren't pressed?Code:chk1: PAUSE 25 ' Pause once for each loop ' Check Button 1 (Skip to 2 if Not Pressed) BUTTON FOCLBN, 0, 40, 5, B1, 0, chk2 TOGGLE LED1 ' Toggle LED if pressed chk2: ' Check Button 2 (Skip to 1 if Not Pressed) BUTTON FOCRBN, 0, 40, 5, B2, 0, chk1 TOGGLE LED2 ' Toggle LED if pressed GOTO CHK1 END




Bookmarks