Going crazy! How do I compare 2 numbers? Please help!

Hi, I’m trying to compare 2 simple integers. 

http://docs.coronalabs.com/guide/start/introLua/index.html#relational-operators says 

“Numbers and strings are compared in the usual way.” - Sounds simple eh? 

I try the following where both numValue and are set to integer 1 : 

print(numValue) print(localExhibitorRevision) print(type(localExhibitorRevision)) print(type(numValue))     if numValue == localExhibitionRevision then         print("Bingo")     else         print("Nada")     end

Terminal tells me 

1

1

number

number

Nada

so I get confirmation that my values have not changed and they are both the same type but for some reason I don’t get the Bingo but I get Nada which tells me for some reason Corona thinks 1 is not equal to 1. 

I then change my relational operator to > to test if one variable is greater than the other one using : 

 if numValue > localExhibitionRevision then

and run the same code. I get the following in the terminal : 

1

1

number

number

Runtime error

…0_979kb60vx5cvv80000gn/T/TemporaryItems/158/main.lua:234: attempt to compare nil with number

stack traceback:

I’m about to go crazy. Anyone have an idea what I might be doing wrong? Thank you so much for your help. 

Well, the ‘nil’ line comes from the fact that you’re calling it “Exhibitor” at the top and “Exhibition” at the bottom. :slight_smile:

You know what? I read this piece of sh…err, code for so many hours I totally missed that. I must be going blind. I apologize for the collective forum time taken from all of you. Will delete this post to hide my shame. Thank you very much for your help.

Don’t sweat it. Pretty sure I’ve had a dozen of these threads over the years :wink:

Well, the ‘nil’ line comes from the fact that you’re calling it “Exhibitor” at the top and “Exhibition” at the bottom. :slight_smile:

You know what? I read this piece of sh…err, code for so many hours I totally missed that. I must be going blind. I apologize for the collective forum time taken from all of you. Will delete this post to hide my shame. Thank you very much for your help.

Don’t sweat it. Pretty sure I’ve had a dozen of these threads over the years :wink: