variable memory usage

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

User avatar
Kint
a hill giant
a hill giant
Posts: 208
Joined: Thu Mar 13, 2003 3:36 am

variable memory usage

Post by Kint » Sat Jun 21, 2003 4:28 am

I wanted to ask a few questions about variables. When I use a macro with more then maybe 5 variable assignments my memory usage goes way through the roof. after a night of macroing I'll have a 1gb page file. Maybe if there questions were answered I'd understand it a bit better. how much memory is allocated for different variables? And what's the difference between l#, v#, and p# variables? thanks

kagonis
a hill giant
a hill giant
Posts: 228
Joined: Sat May 24, 2003 8:48 pm

Post by kagonis » Sat Jun 21, 2003 1:31 pm

l# variables are local variables. They only exist in the sub routine they are initiated in.

v# variables are global variables. They exist in the entire macro, also gets carried over through #include's

p# variables are parameters given to a sub routine at it's execution, and only exists for that sub routine
Ex:
/call subRoutine "Parameter 0" "Parameter 1" up to a total of 10 parameters are allowed per default (0 to 9)

sub subRoutine
/echo $p0
|Will echo Paramater 0
/return

Can also be given at macro execution, those parameters will be sent to the Main sub routine
/macro myMacro lala bah bah buh
etc.