NSIS: Functions, the easy way
NSIS November 27th, 2007Most functions in NSIS require that you push variables first and then call the function (Call function).
However, there's another way that's more easy, but requires some preparation.
This is the function:
CODE:
-
Function Dump
-
Exch $5
-
StrCpy $LogTemp "$LogTemp$\r$\n$5"
-
FunctionEnd
It concatenates a pushed variable (String in my case) with a variable $LogTemp and stores it in $LogTemp, similar to the ++ operation.
Normally you would have to use it like this:
CODE:
-
Push "Test"
-
Call Dump
Now, put on top of your script following code:
CODE:
-
/**
-
* Initialization for function Dump
-
*/
-
!macro _dump STRING
-
Push "${STRING}"
-
call Dump
-
!macroend
-
!define Dump '!insertmacro "_dump"'
Now you can call the function like this:
CODE:
-
${Dump} ".onInit"
Recent Comments