Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Help with StrCmp (http://forums.winamp.com/showthread.php?t=201297)

bgosalci 6th December 2004 09:16

Help with StrCmp
 
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

RobGrant 6th December 2004 10:43

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-

bgosalci 6th December 2004 11:03

Thanks Rob that works.

Afrow UK 6th December 2004 11:24

There's also LogicLib which is great for those hardcore programmers like myself :)

See Examples\LogicLib.nsi

-Stu

RobGrant 6th December 2004 13:07

Oh yeah, I should look at that sometime, it looks ace.


All times are GMT. The time now is 04:40.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.