Hi, I am Java programmer and new to NSIS I need help with StrCmp. I want to achieve the following:
($var1 != "") == ($var2 != "")
I did not see the way to use Java && (and) operator with StrCmp, is there a way to do the same in NSIS, and how would I compare two variables as shown above.
Thanks
Help with StrCmp
5 posts
StrCmp $var1 "" varOneEmpty neitherVarEmpty
varOneEmpty:
StrCmp $var2 "" varTwoEmpty neitherVarEmpty
varTwoEmpty:
; Do stuff which can only be done if both are empty
Goto post
neitherVarEmpty:
; oops, at least one of them wasn't empty
post:
; stuff to do for either case
-rob-
varOneEmpty:
StrCmp $var2 "" varTwoEmpty neitherVarEmpty
varTwoEmpty:
; Do stuff which can only be done if both are empty
Goto post
neitherVarEmpty:
; oops, at least one of them wasn't empty
post:
; stuff to do for either case
-rob-
Thanks Rob that works.
There's also LogicLib which is great for those hardcore programmers like myself 🙂
See Examples\LogicLib.nsi
-Stu
See Examples\LogicLib.nsi
-Stu
Oh yeah, I should look at that sometime, it looks ace.