lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> DeviceTag = VARIABLE
> {
>     name = "DeviceTag",
>     data_type = Float,
>     address = 100
> }
> 

> if (DeviceTag == "Krish") then

I see a couple of ways:

1. Set a __call metamethod and write
	if (DeviceTag() == "Krish") then

2. If all your VARIABLEs are global, then you can set a __newindex
   metamethod in _G to save VARIABLEs elsewhere and set an __index
   metamethod to retrieve x.value when x is seen and there is a VARIABLE
   named x.

9. Wait for 5.2 and set __eq and write :-)
	if (DeviceTag == "Krish") then