How to add "or" statement alongside "if" statement

After I set box1.text to “0” in the simulator the following code should change it back to 1 (but doesn’t)

[lua]

print ("******* "… box1.text)          --------------------------> terminal says it’s equal to 0

if (box1.text == “” or box1.text == 0) then

box1.text = 1

print ("******* "… box1TimesSplit.text)  -------------------> if statement never triggers, so no print statement

end

[/lua]

I’m thinking it has to do with the formatting of my “or” statement because if I leave the field blank, it correctly changes it to 1.

Thanks for any help. 

Object.text in this case is a string, so its not going to be equal to a plain number.

If you want to compare *.text to a number you should do something like this

if object.text == tostring( 0 ) then -- do your thing ;) end

Object.text in this case is a string, so its not going to be equal to a plain number.

If you want to compare *.text to a number you should do something like this

if object.text == tostring( 0 ) then -- do your thing ;) end