• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Question - Subroutine Returns

Joined
Jan 29, 2021
RedCents
193¢
Looked around ... didn't see any clear examples or other questions about this subject, so here goes ..

I don't seem to have any issues with subroutines returning int or string type variables and picking up the result in the calling macro with ${Macro.Return}
I have not been successful yet trying the same thing with arrays or MQ2Collections types. I am beginning to think it's not possible.

Is it possible for a subroutine to return an array?
Is it possible for a subroutine to return a list (or set or map) from (MQ2Collections)?

Maybe people are avoiding returns and just using outer scoped variables for passing implicitly passing information between macro and subroutine?
 
Looked around ... didn't see any clear examples or other questions about this subject, so here goes ..

I don't seem to have any issues with subroutines returning int or string type variables and picking up the result in the calling macro with ${Macro.Return}
I have not been successful yet trying the same thing with arrays or MQ2Collections types. I am beginning to think it's not possible.

Is it possible for a subroutine to return an array?
Is it possible for a subroutine to return a list (or set or map) from (MQ2Collections)?

Maybe people are avoiding returns and just using outer scoped variables for passing implicitly passing information between macro and subroutine?
(this doesn't answer your question) there are some very serious limitations to the macroquest macro language - have you considered checking out MacroQuest "Next"? with it comes mq2lua and you can use Lua to do so many more things you just simply can't with the mq macro language
 
According to the doco, /return [value|${varname}] is the only way is works. And ${varname} causes any complex type to evaluate down to a value. Sic is correct. Lua is probably a better choice here if you're on Next.
 
Question - Subroutine Returns

Users who are viewing this thread

Back
Top
Cart