简体   繁体   中英

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

可能是highScore.text您正在使用的是字符串值。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM