Not sure if it’s a lua bug or a corona bug… Or if it’s know and not considered a bug… Comparing a string to a number yelds an error:
function main()
local x = “1”
print(x+0>1) --this works
print(x>1) --this yelds an error “attempt to compare number with string”
end
main()
I thought any arithmetic operation would convert strings to numbers… From this reference: http://developer.anscamobile.com/demo/APIReference.pdf
“Lua provides automatic conversion between string and number values at run time. Any arithmetic operation applied to a string tries to convert this string to a number, following the usual conversion rules.”
Comments will be appreciated
thank you,
Bernardo at BogeyBox [import]uid: 79152 topic_id: 16340 reply_id: 316340[/import]