Page 1 of 1 1
Topic Options
#13426 - 2001-10-22 04:31 PM Comparing decimal values
Anonymous
Unregistered


I read somewhere that KIX does not support decimal values, only integers. First, is that still the case? If not, shouldn't this code work....?

$CompVal1 = 5.66

$CompVal2 = GetFileVersion("C:\Program Files\Some Application\App.EXE","FileVersion)
$CompVal2=VAL($CompVal2)

IF $CompVal1 > $CompVal2
? "Something...."
ELSE
? "Something else...."
ENDIF

Top
#13427 - 2001-10-22 04:36 PM Re: Comparing decimal values
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Mike,

Yeah , thats true ! KiX only supports (still) integer math between -2,147,483,648 and 2,147,483,647 ...

But in your case you can compare the fileversions as string !

Try :

code:

$Comp1 = '5.66'
$Comp2 = GetFileVersion("C:\Program Files\Some Application\App.EXE","FileVersion)

if $Comp1 > $Comp2
;upgrade !
endif


Jochen


A good sample to proof that it will work is
SortArray()

[ 22 October 2001: Message edited by: jpols ]

_________________________



Top
#13428 - 2001-10-22 05:22 PM Re: Comparing decimal values
Anonymous
Unregistered


Hmmm.... should be easy enough to work around. Thanks for the insight!
Top
#13429 - 2001-10-22 05:26 PM Re: Comparing decimal values
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
uups ...

don't forget the trailing quotation in ,"File Version")

J.

_________________________



Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.073 seconds in which 0.028 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org