Evaluation of Integer Error

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
flyingjed
Newbie
Posts: 1
Joined: Thu Aug 09, 2012 6:40 pm

Evaluation of Integer Error

Post by flyingjed » Wed Aug 15, 2012 3:24 pm

I've been having weird issues with IF. For some reason it is evaluating incorrectly. I setup a simple example below. I expected the output message to be "50=50", but it doesn't work as expected. By fiddling with the If/Endif statement a bit, I discovered that even though X is displayed as 50, it is being evaluated as some number between 49.9999 and 50. Can anyone tell me why I get the message "5050" in the code below rather than the expected "X=50"?' Thanks everyone :?

Code: Select all

Let>X=50
Message>X
wait>2
    If>X=50 then
    Message>%X%=50
Else
    Message>%X%<>50
EndIF

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Aug 15, 2012 3:30 pm

You are comparing X with "50 then". Which it isn't. The correct syntax is:

Code: Select all

Let>X=50
Message>X
wait>2
    If>X=50
    Message>%X%=50
Else
    Message>%X%<>50
EndIF
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts