NSIS function with more than 1 parameter

Can an NSIS function have more than one parameter?

Why is this code not compiling? If I cannot have more than one parameter for a function, then what are my other parameters (excluding the use of a macro)?

Compilation Error:

The function expects 1 parameter, received 4. Usage: Function function_name

Outfile "test.exe"
Caption ""
Name ""

# Compile Error Here: "Function expects 1 parameters, got 4. Usage: Function function_name"
Function MyFunction p1 p2 p3
    DetailPrint "$p1, $p2, $p3"
FunctionEnd

Section
    DetailPrint "Hello World"
SectionEnd
+5
source share
1 answer

You need to pass parameters to registers and / or to stack :

Function onstack
pop $0
detailprint $0
FunctionEnd

Function reg0
detailprint $0
FunctionEnd

Section
push "Hello"
call onstack
strcpy $0 "World"
call reg0
SectionEnd
+8
source

All Articles