Can I put a few LABELS in a lookup table? If yes how can I then use the label returned to make the program GOTO that label? GOTO does not work with a variable.
Thanks
Surfies
Can I put a few LABELS in a lookup table? If yes how can I then use the label returned to make the program GOTO that label? GOTO does not work with a variable.
Thanks
Surfies
Use ON GOTO or ON GOSUB.
DT
Do what Darrel says.
However, if you need to intermix things in a LOOKUP table, then here is a method to achieve that:
Code:lbl_1stPlace CON $FF lbl_2ndPlace CON $FE lbl_3rdPlace CON $FD lbl_4thPlace CON $FC My_Index_Var VAR WORD MY_LOOKUP_Var VAR WORD '----------------------------------------------------------------- LOOKUP My_Index_Var, [1,2, lbl_1stPlace,3,4, lbl_2ndPlace ,5,6, lbl_3rdPlace,7,8, lbl_4thPlace,9,10], MY_LOOKUP_Var SELECT CASE MY_LOOKUP_Var CASE lbl_1stPlace GOTO 1stPlace CASE lbl_2ndPlace GOTO 2ndPlace CASE lbl_3rdPlace GOTO 3rdPlace CASE lbl_4thPlace GOTO 4thPlace END SELECT '----------------------------------------------------------------- 1stPlace: '----------------------------------------------------------------- 2ndPlace: '----------------------------------------------------------------- 3rdPlace: '----------------------------------------------------------------- 4thPlace:
Thanks Darrel and SteveB will try that and let you know.
This ON GOTO command, does it work with PBP 2.32 ?? here is part of the code;
COUNT PORTC.3, 15000, c1 'put pulses in C1
ON c1 GOTO S1,S2,S3,S4,S5,S6,S7,S8 I get a syntax error on this line, do I miss something? S1 to S8 is labels, C1 is defined as a variable.
Thanks.
does it work with PBP 2.32 ???
Wowwww !!!
PBP2.32 might be @ least 10 years old ... more than time to upgrade !
my 2.50 version manual does not show ON GOxxx commands ( appears in the v2.60 manual ), sooo ... prepare your
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks