Archive: User Variables


User Variables
Hi,

I'am thinking about changing the source code to support unlimited user variables, because in large projects, is very dificult to not make some stupid errors like "forget some push/pop mixed with plugins, etc". The idea is create another especial user var ( ex: $V) and two methods (Set/Get):

example:
Set Name Ramon
Set Country Japan
Get Name
MessageBox MB_OK "My name is $V"

Get Country
MessageBox MB_OK "I'am from $V"

...

So, every time we call "Get VAR_NAME" the result will be stored in special variable $V. I hope you understand my thoughts

Currently I have this implemented as macros with pluging /NOUNLOAD, but I think that this can be less *heavy* if used inside engine :p

Sugestions are welcome

cya
Ramon


Well in your example:


OutFile "SameVAR.exe"
Name "Same VAR"



Function .onInit
StrCpy $0 "Ramon"
MessageBox MB_OK "My name is $0"
StrCpy $0 "Japon"
MessageBox MB_OK "I'am from $0"
Quit
FunctionEnd

Section ""
;I'm a ghost, boo
SectionEnd

See :) re-use them

I'm already working ona change that will result in this capability too (it'll be inlined, no get/set just $myvar). It would be nice if you could post the plug-in in the archive as a temporary solution though.


Ok I will post the plugin for now