Technical support and scripting issues
Moderators: JRL, Dorian (MJT support)
-
flyingjed
- Newbie
- Posts: 1
- Joined: Thu Aug 09, 2012 6:40 pm
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
-
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