Cannot Compare Arguments
#1
Posted 07 August 2012 - 11:02 PM
Why..?
#2
Posted 07 August 2012 - 11:22 PM
#3
Posted 07 August 2012 - 11:33 PM
An easy way to fix it is to put string(value1) == string(value2) if you are comparing something that may have letters, or real(value1) == real(value2) if you are sure it will only have numbers.
#4
Posted 07 August 2012 - 11:47 PM
Generally the 'Cannot compare arguments' error is caused by 2 different types of values being compared, i.e. number compared to string.
An easy way to fix it is to put string(value1) == string(value2) if you are comparing something that may have letters, or real(value1) == real(value2) if you are sure it will only have numbers.
Man, you just made me feel kind of stupid for not realizing that... The problem is that text files save everything as strings, so you have to apply the real() function to the value you're reading from the file.
#5
Posted 08 August 2012 - 01:17 AM
Generally the 'Cannot compare arguments' error is caused by 2 different types of values being compared, i.e. number compared to string.
An easy way to fix it is to put string(value1) == string(value2) if you are comparing something that may have letters, or real(value1) == real(value2) if you are sure it will only have numbers.
Man, you just made me feel kind of stupid for not realizing that... The problem is that text files save everything as strings, so you have to apply the real() function to the value you're reading from the file.
I was just about to say that my description was well enough since I added string() and it worked. Thanks thegame! (I +1'd
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











