'Macro label proglem'
I have a little problem with a macro (shown below) I am trying to use. Its
function is to check four buttons, and then to branch accordingly, although
that is not really important in terms of this problem.
The macro works beatifully the first time I use it. However, when I try to
use it a second time, the _DoMenu_2, _DoMenu_3 and _DoMenu_4 labels are
duplicated. How do I prevent this? I have tried using the 'Local'
directive, without success - all the examples I can find in the user's
guide only show how to use it to declare a local variable, not a local
Help would be very much appreciated...
_DoMenu Macro _Opt1, _Opt2, _Opt3, _Opt4, _NoBut
Btfss ButSta, Button1 ; Button pushed?
Goto _DoMenu_2 ; no
Bcf ButSta, Button1 ; yes, clear pushed flag
Goto _Opt1 ; Branch to option
Btfss ButSta, Button2 ; Button pushed?
Goto _DoMenu_3 ; no
Bcf ButSta, Button2 ; yes, clear pushed flag
Goto _Opt2 ; Branch to option
Btfss ButSta, Button3 ; Button pushed?
Goto _DoMenu_4 ; no
Bcf ButSta, Button3 ; yes, clear pushed flag
Goto _Opt3 ; Branch to option
Btfss ButSta, Button4 ; Button pushed?
Goto _NoBut ; no - no button is pushed
Bcf ButSta, Button4 ; yes, clear pushed flag
Goto _Opt4 ; Branch to option
More... (looser matching)
- Last day of these posts
- In 1997
, 1998 only
- New search...