Archive: how to compare two numbers?


how to compare two numbers?
how to compare two numbers???
or how to get a number from the registry?

is there something like

if(a<b)
{
MessageBox......

????

how do you compare if you don´t do it like that???

iam new to nsis... i just have some knowledge about c++


Everything you have asked here is documented in the NSIS documentation.

-Stu


hm i just saw strcmp.... but i wanna read the registry entry in as a number i did that a look at the documentation...

and comparing two numbers??? i didn´t find that either...

maybe iam just blind but i can´t find it


See:
Variables
IntCmp
ReadRegStr

-Stu


thx and sorry....

i really have been blind...
i have to get into it..

thx for you patience
i appreciate that


Sorry, it's me that never had any patience.
I would usually have helped you a lot more, but it's too late (time) :(

I will be able to help you better tomorrow. :)

-Stu


it´s no prob...
i will hit you if i can´t get it to work...

i installed nsis yesterday and it´s really hard in the beginning...

so sorry if i seem to be a bit dumb...


another thing....

is there a chance to compare two numbers which
are float??? cause all versionnumbers got something
like 1.05 or something like that...

and i don´t think IntCmp can do that cause it only does take
only "whole" numbers...
at least in c++ this would be right....


I use StrCmp like this:


StrCmp "1.26" "1.056" 0 +3
MessageBox MB_OK "Equal"
goto +2
MessageBox MB_OK "No Equal"

so i can´t check is the version is lower or equal right?


There is a script in the Archive that might do what you want:

"Basically it contains a small function called VersionCheck which correctly compares two dotted notation version strings (e.g. 3.5 and 3.5.1.4) and indicates which of the two is the higher version."

http://nsis.sourceforge.net/archive/....php?pageid=57


thx... that could be the answer...
if not i could use version numbers without dots...

but i will test it