Macro in a macro? Why do they conflict?

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

hank
decaying skeleton
decaying skeleton
Posts: 6
Joined: Thu Dec 11, 2003 5:27 pm

Macro in a macro? Why do they conflict?

Post by hank » Thu Dec 11, 2003 5:33 pm

Sometimes I can have a macro switch macros. For example, adding the
/macro
command inside another macro.



But the one I'm trying to run now has conflicts from it's host macro. It runs fine on its own, but when I try and use /macro walkpath from another macro, it gives me variable errors :(

I've tried using the /zapvars command before the /macro command with no luck.

Is there anyway to end a macro, then have another start? Maybe using a delay or something?

Thanks!

User avatar
FreQuency
a hill giant
a hill giant
Posts: 215
Joined: Tue Sep 23, 2003 6:03 pm

Post by FreQuency » Thu Dec 11, 2003 7:18 pm

best bet use a main program for control and then copy the other .mac files and copy them into .inc files #include them and rename the mains and jsut call them.

Sorry that may be a bit confusing. If someone cares to expalin better be my guest or i can try again later when im nto ina rush

Goofmester1
a hill giant
a hill giant
Posts: 241
Joined: Thu Nov 06, 2003 4:26 am

Post by Goofmester1 » Thu Dec 11, 2003 8:08 pm

Could be that you are using the same variable names in both and they are conflicting due to that. Try clearing all variables just before calling the new macro.

hank
decaying skeleton
decaying skeleton
Posts: 6
Joined: Thu Dec 11, 2003 5:27 pm

Post by hank » Thu Dec 11, 2003 8:26 pm

I got it working!

#include probably would have been smarter, but I just copied over the /declare and /var statements over to the host macro.