Unequal if statement?? != or <>

Moderator: leecollings

Post Reply
rgroothuis
Posts: 347
Joined: Friday 03 April 2015 17:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Unequal if statement?? != or <>

Post 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.
rgroothuis
Posts: 347
Joined: Friday 03 April 2015 17:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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.
User avatar
nayr
Posts: 354
Joined: Tuesday 11 November 2014 18:42
Target OS: Linux
Domoticz version: github
Location: Denver, CO - USA
Contact:

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

Post 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
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest