Searching \ for 'Macro label proglem' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=macro+label+proglem
Search entire site for: 'Macro label proglem'.

Truncated match.
PICList Thread
'Macro label proglem'
1997\08\13@115925 by Agrico LTX

picon face
Hello Everyone!!

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
label.

Help would be very much appreciated...
Thanks
       Roland

_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
_DoMenu_2
       Btfss   ButSta, Button2 ; Button pushed?
       Goto    _DoMenu_3       ; no
       Bcf     ButSta, Button2 ; yes, clear pushed flag
       Goto    _Opt2           ; Branch to option
_DoMenu_3
       Btfss   ButSta, Button3 ; Button pushed?
       Goto    _DoMenu_4       ; no
       Bcf     ButSta, Button3 ; yes, clear pushed flag
       Goto    _Opt3           ; Branch to option
_DoMenu_4
       Btfss   ButSta, Button4 ; Button pushed?
       Goto    _NoBut          ; no - no button is pushed
       Bcf     ButSta, Button4 ; yes, clear pushed flag
       Goto    _Opt4           ; Branch to option

       EndM

More... (looser matching)
- Last day of these posts
- In 1997 , 1998 only
- Today
- New search...