How to use a variable in the whole program and not only in the "If then"statement?.
example to determine the variable x
Code: Select all
commandArray = {}
if (devicechanged['RemoteWK2'] == "Off") then
print(' Switch is Off')
x = 1
print(' X = : ' .. x .. ' ');
end
if (devicechanged['RemoteWK2'] == "On") then
print('Switch is On')
print(' X = : ' .. x .. ' ');
end
print(x)
return commandArray
Thx