Guest thandor32 Posted April 25, 2004 Share Posted April 25, 2004 Hi there, i got a slight problem with one of my scripts: I read data from a webpage (digits) by copying it into the clipboard and then pasting it into variables. Variable $a gets assigned 9 this way and variable $b is 11. Before comparing the 2 i check their content with a msgbox which gives me the correct resulst: $a = 9 and $b = 11 Still: if $a < $b then msgbox... doesnt get triggered any ideas why this could be the case ? I suspected this was because i used StringMid to read the digits from the clipboard, but if i use StringIsDigit on $a or $b it says true. Link to comment Share on other sites More sharing options...
Valik Posted April 25, 2004 Share Posted April 25, 2004 They are being compared as strings. Cast them to numbers. $a = Number($a) $b = Number($b) Link to comment Share on other sites More sharing options...
Guest thandor32 Posted April 25, 2004 Share Posted April 25, 2004 thanks a lot, u saved my day i thought it could be something like this, however it worked fine all the time till now (luck on my side most probably) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now