Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   question on logiclib (http://forums.winamp.com/showthread.php?t=219083)

jsbach 16th June 2005 23:19

question on logiclib
 
i have:
...
var Var1
var Var2
...
${If} $Var1 <> $Var2
; do action 1...
${Else}
; do action 2...
${EndIf}

When values are different i expect 'action 1' being executed but this never happens. for example:
Var1 = "1.3.1.0"
Var2 = "1.4.1.0"

i'm getting 'action 2' executed. Why ?

thanks.

ps. not yet tried with latest version of logiclib (just downloaded). Now using lib which comes with nsis 2.06.

onad 17th June 2005 08:47

Please give amore complete example what you do e.g. how do you assign the values to Var1 and 2

surly NOT with :

Var1 = "1.3.4.5"

because that will not work ;)

glory_man 17th June 2005 11:20

If you want compare 2 versions use "VersionCompare" scripts. Search for forum and NSIS Archive.
For example this link.

jsbach 20th June 2005 09:43

found why
 
thanks for the two replies: paying more attention at logiclib.nsh description i understood my error was not to use the right comparison command:
<> for signed integer tests (built-in);
!= for string tests (built-in);
S!= for case-sensitive string tests (using System.dll);
S> for case-insensitive string tests (using System.dll)
and so on...

So the right working code becomes:

${If} $Var1 S> $Var2 ; (or $Var1 != $Var2 if i want to check just differences)
; do action 1...
${Else}
; do action 2...
${EndIf}

And about versions compare, specific UDFs maybe fine but logiclib, when used properly, could be just enough in most cases.

thanks.


All times are GMT. The time now is 18:02.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.