- NSIS Discussion
- how to compare two numbers?
Archive: how to compare two numbers?
Noobico
19th July 2003 22:39 UTC
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++
Afrow UK
19th July 2003 23:16 UTC
Everything you have asked here is documented in the NSIS documentation.
-Stu
Noobico
19th July 2003 23:18 UTC
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
Afrow UK
19th July 2003 23:19 UTC
See:
Variables
IntCmp
ReadRegStr
-Stu
Noobico
19th July 2003 23:33 UTC
thx and sorry....
i really have been blind...
i have to get into it..
thx for you patience
i appreciate that
Afrow UK
20th July 2003 00:22 UTC
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
Noobico
20th July 2003 00:39 UTC
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...
Noobico
20th July 2003 18:52 UTC
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....
Joel
20th July 2003 20:21 UTC
I use StrCmp like this:
StrCmp "1.26" "1.056" 0 +3
MessageBox MB_OK "Equal"
goto +2
MessageBox MB_OK "No Equal"
Noobico
20th July 2003 20:27 UTC
so i can´t check is the version is lower or equal right?
pengyou
20th July 2003 23:08 UTC
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
Noobico
20th July 2003 23:21 UTC
thx... that could be the answer...
if not i could use version numbers without dots...
but i will test it