Skip to content
⌘ NSIS Forum Archive

LogicLib help

3 posts

Joel#

LogicLib help

I'm trying to convert this C style code:
if ( (someVal != 0) || (someVal < VERSION) ) {
//... give outhandle = 1
}
elseif ( (someVal != 0 ) || (someVal == VERSION) ) {
// ... give outhandle = 2
} 
And this gives me error "_If" requires 4 parameter(s), passed 8!:
${IF} $R0 != 0 ${OR} $R0 < ${VERSION}
StrCpy ${outHandle} 1
${ELSEIF} $R0 != "" ${OR} $R0 = ${VERSION}
StrCpy ${outHandle} 2
${ENDIF} 
Any help?
demiller9#
${IF} $R0 != 0
${ORIF} $R0 < ${VERSION}
StrCpy $outHandle 1
${ELSEIF} $R0 != "" 
${ORIF} $R0 = ${VERSION}
StrCpy $outHandle 2
${ENDIF} 
You might also find that you need quotes around the $R0 operands.

$outHandle should be declared with 'Var'. ${outHandle} is declared with '!define' and probably won't let you StrCpy to it.

Don