![]() |
Function with variable
I would like to call a function and give a certain variable like:
Call MyFunction "variable string" Function "MyFunction" $1 MessageBox MB_OK "$1" FunctionEnd Is this possible? |
code: Or use macros: Stucode: |
I can't understand clearly how stack and variables are managed.
Can you explain ? On one hand, there is a stack. On the other hand, many variables... $0..$R0 among them. What should be passed to the function ? the stack ? So let's push $1 on top of the stack code: And now run the func code: At this point, I misunderstand what is available to the function and what is not. $1 is a global var, can be seen from anywhere. So MyFunction can read and feed it with some value ... no ? Why dealing with stack ? code: Quote:
code: Then, code: again, what for ? saving the new value "value2" of $1 in stack ? (to make the parameter $1 as in and out ?) Sometimes, functions run "pop $1".... what that does ? remove the value at stack top and feed $1 with it ? Many thanks to help me to understand a bit, I read again and again the doc but fail to understand. Gal' |
You use the stack so that you can call the function without having to use the same variable to pass a value.
http://nsis.sourceforge.net/Pop,_Pus...h..._The_Stack Stu |
Okay thank you very much. The link you give me describes the in and out of a stack behaviour, but you point out the key: no need to use global var thanks to this stack-of-parameters.
Many thanks ;) Gal' |
| All times are GMT. The time now is 04:37. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.