Page 1 of 1

Numeric Comparison

Posted: Fri May 09, 2008 12:27 pm
by woreid
How can I do numeric comparisons? The Mathematics function doesn't work and the other operators do string compares.

Posted: Sat May 10, 2008 5:34 am
by CandiceJones
Mathematics works, of course. If automatically does numeric comparisons when both parameters resolve to numeric values.

Posted: Mon May 12, 2008 6:54 am
by woreid
No. Mathematics does not work for me.

~InstallAware Clipboard Data~
~Comment~
~{BA079DA4-72C8-4D70-B425-DDA21BF4C856}~
~~
~Terminate Install~
~{76C49C8E-9653-43AF-A9A4-CC0C8B7573EB}~
~MessageBox~
~{69B7211B-4D05-41E9-B1FE-38AD1FBCB108}~
~~
~$Var2$~
~0~
~1~
~~
~Mathematics~
~{EC052B3B-00D3-4F9D-9DFF-91CB50DD0048}~
~Var1~
~5000~
~0~
~Var2~
~Set Variable~
~{296E37AA-DDDB-48E1-A984-396B137146FA}~
~Var2$MYAH$MYAH$FALSE~
~0~
~Set Variable~
~{60CE1C91-A955-4B3A-AE2D-63DDA9590F6F}~
~Var1$MYAH$MYAH$FALSE~
~10000~

That simple program gives me an empty string. Now what?

Posted: Mon May 12, 2008 9:04 am
by CandiceJones
There's a bug in your code :)

Var2 = Var1 + 5000

is wrong

$Var2$ = $Var1$ + 5000

is correct

Posted: Mon May 12, 2008 10:03 am
by woreid
OK. That works, but this doesn't. Checking disk space was how this all started for me. :?

~InstallAware Clipboard Data~
~Terminate Install~
~{76C49C8E-9653-43AF-A9A4-CC0C8B7573EB}~
~MessageBox~
~{69B7211B-4D05-41E9-B1FE-38AD1FBCB108}~
~~
~$Var2$~
~0~
~1~
~~
~Mathematics~
~{EC052B3B-00D3-4F9D-9DFF-91CB50DD0048}~
~$Var1$~
~5000~
~0~
~Var2~
~Set Variable~
~{296E37AA-DDDB-48E1-A984-396B137146FA}~
~Var2$MYAH$MYAH$FALSE~
~0~
~Check Disk Space~
~{55EA3C8C-4A58-470C-BD9D-FA80B2A4F975}~
~Var1~
~c:\\~
~TRUE~
~FALSE~
~Set Variable~
~{AADCFFC9-ADBF-4A9E-AF31-16CAD8562016}~
~Var1$MYAH$MYAH$FALSE~
~0~

Posted: Mon May 12, 2008 4:42 pm
by CandiceJones
The value is an Int64 value which is creating the problem. We should have an update for this very soon!

Fixed yet?

Posted: Thu Jul 10, 2008 2:33 pm
by klavelle
Is this bug fixed yet?

This still fails:

Get Free Space on C:\\ into variable availDiskSpace

Set Variable reqSpace to 2048000000
Evaluate Expression $availDiskSpace$ >= $reqSpace$ into variable diskSpace

diskSpace will be false, where it should return true ($availDiskSpace$ while running this is well over 2 GB).

Is there any other way to check for free disk space?

Posted: Thu Jul 10, 2008 7:27 pm
by CandiceJones
You should use If for that. Evaluate Expression performs logical operations on strings only.

Posted: Tue May 19, 2009 12:08 pm
by sdeschenes
I am trying to perform the same operation as Klavelle. I have tried using the Evaluate Expression command, the Eval command provided by the Camelot plug-in and I have used the standard If statement. I have varA set to 1978 and varB set to 16327196672. When I check to see if varA is greater than varB, the Evaluate Expression and Eval commands return True and the if statement also returns true.

You mentioned that the value is an Int64 value. Did you ever get a fix for this?

Posted: Tue May 19, 2009 5:02 pm
by CandiceJones
Yes, try with InstallAware 9.01.