Calling a macro from a macro - /declare problem

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

morevit
a lesser mummy
a lesser mummy
Posts: 47
Joined: Tue Sep 14, 2004 10:35 am

Calling a macro from a macro - /declare problem

Post by morevit » Thu Sep 30, 2004 8:25 am

This is not normally something I do, but it seemed the simplest solution when using the MQ2MyButtons plugin (i.e. have a set of fixed macros called by the buttons which then called your custom macros).

The problem I'm having is that apparently the first /declare in the called macro is not being recognized. It's possible the issue is with the first command rather than the first /declare but I don't think so. The called macros work fine when invoked directly from the command line of course.

User avatar
fice
a hill giant
a hill giant
Posts: 187
Joined: Thu Jul 17, 2003 3:28 pm

Post by fice » Thu Sep 30, 2004 3:00 pm

When you call a macro it ends the macro currently running and starts the new one you called, it doesn't return to the original one. What you need to do is add Sub functions inside the macro already running, and in these functions you should specify what the other macros you have, do.

eqjoe
a grimling bloodguard
a grimling bloodguard
Posts: 984
Joined: Sat Sep 28, 2002 12:26 pm

Post by eqjoe » Thu Sep 30, 2004 7:53 pm

Edit the source to his plugin to call your macro.



-j

morevit
a lesser mummy
a lesser mummy
Posts: 47
Joined: Tue Sep 14, 2004 10:35 am

Post by morevit » Fri Oct 01, 2004 6:42 pm

fice wrote:When you call a macro it ends the macro currently running and starts the new one you called, it doesn't return to the original one. What you need to do is add Sub functions inside the macro already running, and in these functions you should specify what the other macros you have, do.
Well aware of that. That's not the issue. The situation is this...

Code: Select all

------------------------------------------
|
| A.mac
|

sub Main
    /macro B
/return

Code: Select all

-------------------------------------------
|
| B.mac
|
sub Main
    /declare Foo string local
    /declare Bar string local

   /varset Foo abc
   /varset Bar def

   /echo ${Foo}${Bar}
/return
-------------------------------------------
The result of executing /mac A is an error message stating that "Foo" isn't defined on the set statement. This has nothing to do with the early termination of macro "A".

morevit
a lesser mummy
a lesser mummy
Posts: 47
Joined: Tue Sep 14, 2004 10:35 am

Post by morevit » Fri Oct 01, 2004 6:44 pm

eqjoe wrote:Edit the source to his plugin to call your macro.



-j
Obvious and wholy not the point. I want the buttons to be configurable from within EQ, not to require a recompile of the plugin every time I make a change.