Archive: !ifdef question


!ifdef question
hello,

i have a question.
i searched the archive and the forum.
i need in my script a line like this

i have 6 variables that takes values : -1, 1, 0.
i need a condition (!ifdef i think) something like this :

!ifdef ($R2 == "0" | $R3 == "0" | $R4 == "0" | $R5 == "0" | $R6 == "0" | $R7 == "0")

but this does not work.
any ideas ?
i really need to check that all of them are "0".


If you want to test the value of "variables", you can use StrCmp, IntCmp or IntCmpU (see sections 4.9.4.18, 4.9.4.12 and 4.9.4.13 in the NSIS Users Manual).

!ifdef is used for testing "symbols" (see section 5.3 in the NSIS Users Manual)


!ifdef does compile time checking. Is that what you want?
If you need runtime checking using StrCmp domething like this:
StrCmp $R1 "0" 0 error
StrCmp $R2 "0" 0 error
StrCmp $R3 "0" 0 error
StrCmp $R4 "0" 0 error
StrCmp $R5 "0" 0 error
StrCmp $R6 "0" 0 error
#Do your other stuff here
goto done
error:
MessageBox MB_OK "Error"
done:


Originally posted by iceman_k
...StrCmp $R1 "0" 0 error ...
it was in front of me and i could not see it...:igor:

i used StrCmp in my script (the same script, only a few lines lower) and i did not think of it...

thanks man...