PDA

View Full Version : Button command, definition badly worded !?!



lerameur
- 15th December 2010, 15:39
Hi, I have been reading the BUTTON definition and its still givin me a headack. Unlike a gosub, when it terminate itself with the END command, there is nothing to show where the BUTTON action ends.
This is the example in the Pic basic manual:

Loop: BUTTON Bpin,1,10,5,B0,0,notp
Serout SO,N2400,["Press",13,10] '

notp: Serout SO,N2400,[#B0,13,10]
Pause 100
Goto Loop


If I was to add lines after the Pause 100, How would I know that it is included in the notp: or not. It would be much easier to end the notp: with an End :ie

notp: Serout SO,N2400,[#B0,13,10]
Pause 100
End 'of course I made that up!
....
CODE here
...
Goto Loop

Other wise it will think the CODE is to be executed withing the button parameter.

Can someone clear me out on this one ?

K

lerameur
- 16th December 2010, 01:45
Humm, nobody yet.

Ok basically I want to replace a, If Then loop with a button.
If hten loop and an ENDIF to terminate it. But BUTTON, has nothing to end it so thats where the problem is.

Any suggestions on how to terminate a BUTTON command ??

K

Acetronics2
- 16th December 2010, 07:27
Hi, Ken

What else to tell you ... ???

you had a look to the " official example " ... ;)

just consider BUTTON like the asm BTFSS or BTFSC command ... that here jumps to label if condition is NOT true.
ELSE continue next line.

that's you to care to the program flow ...

remember programming the old HP 19/29/41 calculators ??? ... :D

Alain