NSIS功能超过1个参数

saz*_*azr 5 nsis

NSIS功能可以有多个参数吗?

为什么这个代码不会编译?如果我的函数不能超过1个参数,那么我的其他选项是什么(无论使用宏)?

编译错误:

函数需要1个参数,得到4.用法:函数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
Run Code Online (Sandbox Code Playgroud)

And*_*ers 8

您必须在寄存器和/或堆栈中传递参数:

Function onstack
pop $0
detailprint $0
FunctionEnd

Function reg0
detailprint $0
FunctionEnd

Section
push "Hello"
call onstack
strcpy $0 "World"
call reg0
SectionEnd
Run Code Online (Sandbox Code Playgroud)