Old 16th June 2005, 23:19   #1
jsbach
Junior Member
 
Join Date: Feb 2005
Location: Italy
Posts: 42
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.
jsbach is offline   Reply With Quote
Old 17th June 2005, 08:47   #2
onad
Senior Member
 
onad's Avatar
 
Join Date: Dec 2004
Location: Turkey
Posts: 447
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

"Just do it"
onad is offline   Reply With Quote
Old 17th June 2005, 11:20   #3
glory_man
Senior Member
 
Join Date: Sep 2004
Location: Mogilev (Belarus)
Posts: 372
If you want compare 2 versions use "VersionCompare" scripts. Search for forum and NSIS Archive.
For example this link.
glory_man is offline   Reply With Quote
Old 20th June 2005, 09:43   #4
jsbach
Junior Member
 
Join Date: Feb 2005
Location: Italy
Posts: 42
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.
jsbach is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump