General area when it fits no where else

Moderator: Mmiscool

User avatar
By Alberto_2
#74550 I am getting the following error message : "Error in line 224: Comparison between string and number!"

But in line 224 I do compare a numerical variable "kkk" with a number. The strange thing is that the variable "kkk" is also compared in other part of the code without any error message. The error is detected inside button branch (gpio7) while the comparison inside onother branch (gpio3) do not report any error.

I did try to use "=" for number and "==" for strings but then I get dozzen errors and the code doesn't work anymore.
Did also try to set kkk =0 at the begining of the code to stress that kkk is numerical but not avail, I continue to get the error all the time I press the button to branch to gpio7.

The program seems to work without any apparent problem, appart the error message. Any suggestion?

Thank you.
Alberto
User avatar
By heckler
#80165 Hi Alberto,

I have experienced the same thing.

Error that there is a "comparison between string and number" even though my code is correct.
I believe it may be a problem that occurs when your code is saved to the module from the editor window.

The only thing I have done to be able to correct it is to delete the line, do a save, and then re-enter the line again and save the corrected code.

I have also experienced an issue where code gets corrupted between a save / edit... such as

tdp = tdp % 10

where the % seems to get changed to garbage.

Did you ever come up with a solution??

hope this helps
dwight
User avatar
By heckler
#80168 In fact I am having this problem right now.
After several saves and trying everything I have just now remarked out the bad line and entered it again on the next line to see if that will fix it.

anybody else have this problem, or solution??

thanks
dwight