Beri
Beri

Reputation: 245

Why do i get this error when trying to check if in Corona sdk?

if myGameSettings.HighScore > highScore.text then
end

I am trying to check if this conditions is true but i get this error saying attempt to compare string with number

I have tried to use it like this too

if tonumber(myGameSettings.HighScore) > tonumber(highScore.text) then
end

Upvotes: 0

Views: 63

Answers (1)

Akshada-Systematix
Akshada-Systematix

Reputation: 321

Might be highScore.text you are using is a string value.

Upvotes: 1

Related Questions