Page 1 of 1

Unequal if statement?? != or <>

Posted: Thursday 11 February 2016 20:52
by rgroothuis
Help ! I'm searching for the unequal if statement!

This
if (a != b) then
of
if (a <> b) then

is not working, what is the correct way of doing this?

Thanks.

Re: Unequal if statement?? != or <>

Posted: Thursday 11 February 2016 21:18
by rgroothuis
I think I finally found my own answer :-) This is not something that is widely used.

The solution is:
if (a ~= b)

Please note the above ~ is NOT the - (minus) character.

Re: Unequal if statement?? != or <>

Posted: Thursday 11 February 2016 21:23
by nayr
If you didnt find it, here is the specific doc you were looking for, there are a lot more worth looking through, lua is unique enough to be maddening sometimes..

http://www.lua.org/pil/3.2.html