PDA

View Full Version : On...gosub



circuitpro
- 5th December 2009, 03:31
An 'ON...GOSUB' function would really be nice. Read a button, and handle it, without a whole list of IF..THEN's. :cool:

Bruce
- 5th December 2009, 03:54
ON GOSUB is already in PBP V2.60.

Acetronics2
- 5th December 2009, 09:43
Read a button, and handle it, :

Hi,

For a button you also have the :

"BUTTON" function ...

No, please ... do not strike on the head !!!

Seriously ...

SELECT CASE Also does the Job ...

Which release do you use ???

Alain

circuitpro
- 5th December 2009, 18:24
That was quick :D

Im not using 'button', cause I'm using PCF8574's, but the ON...GOSUB will definately speed up my response code!

Acetronics2
- 5th December 2009, 18:45
SELECT CASE Also does the Job ...


Update

SELECT CASE Also BETTER does the Job ...

as you read a BYTE from the '8574 ...

Alain

circuitpro
- 7th December 2009, 22:40
You're absolutely right. The SELECT...CASE function works better than an ON...GOSUB for reading a bank of buttons using PCF8574 (or a whole port). You can do the decode right there. Thanks! I never looked very closely at this instruction... at first glance I thought it was related to Upper/Lower case conversion... oops!

Thanks again