Sign in to follow this  
Followers 0
foster74

Adding variables working sporadically, any work around?

4 posts in this topic

When running the following code:

$Var1 = 9.05
$Var2 = 8.81
$Var3 = $Var2 + .24
$Var4 = $Var1 = $Var3
$Var5 = $Var1 - $Var3
msgbox(0,"TEST","$Var4 = " & $Var4 & @CRLF & "$Var5 = " & $Var5)

$Var1 = 8.05
$Var2 = 7.81
$Var3 = $Var2 + .24
$Var4 = $Var1 = $Var3
$Var5 = $Var1 - $Var3
msgbox(0,"TEST 2","$Var4 = " & $Var4 & @CRLF & "$Var5 = " & $Var5)

The first message box displays the expected text. "$Var4 = True $Var5 = 0"

The second displays: "$Var4 = False $Var5 = 1.77635683940025e-015"

Any ideas? Thanks.

Share this post


Link to post
Share on other sites



$Var1 = 9.05
$Var2 = 8.81
$Var3 = Eval($Var2 + .24)
$Var4 = $Var1 = $Var3
$Var5 = $Var1 - $Var3
msgbox(0,"TEST","$Var4 = " & $Var4 & @CRLF & "$Var5 = " & $Var5)

$Var1 = 8.05
$Var2 = 7.81
$Var3 = Eval($Var2 + .24)
$Var4 = $Var1 = $Var3
$Var5 = $Var1 - $Var3
msgbox(0,"TEST 2","$Var4 = " & $Var4 & @CRLF & "$Var5 = " & $Var5)

Share this post


Link to post
Share on other sites

Awesome, thank you very much! It turns out it's actually Execute not Eval that was needed, but it sent me right to it! I was stuck on that one for a long time, since it works without Execute most of the time. Thanks again.

Share this post


Link to post
Share on other sites

heh lol yeah I see:

$Var1 = 9.05
ConsoleWrite($Var1 & @CRLF)
$Var2 = 8.81
ConsoleWrite($Var2 & @CRLF)
$Var3 = Execute($Var2 + 0.24)
ConsoleWrite($Var3 & @CRLF)
$Var4 = Execute($Var1 == $Var3)
ConsoleWrite($Var4 & @CRLF)
$Var5 = Execute($Var1 - $Var3)
msgbox(0,"TEST","$Var4 = " & $Var4 & @CRLF & "$Var5 = " & $Var5)

$Var1 = 8.05
ConsoleWrite($Var1 & @CRLF)
$Var2 = 7.81
ConsoleWrite($Var2 & @CRLF)
$Var3 = Execute($Var2 + .24)
ConsoleWrite($Var3 & @CRLF)
$Var4 = Execute($Var1 == $Var3)
ConsoleWrite($Var4 & @CRLF)
$Var5 = Execute($Var1 - $Var3)
msgbox(0,"TEST 2","$Var4 = " & $Var4 & @CRLF & "$Var5 = " & $Var5)
ConsoleWrite('(\/ )' & @CRLF & '( o0)' & @CRLF & '(")(")' & @CRLF)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0