This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Strange thing in Lua
#1
I'm trying prepare some solution but I've have some strange problem in one script. I am trying fill the 'responseType' property in state variable but it is not working.


Code:
local responseType = cmd.responseType
log('responseType', responseType)
local state = {value = responseType, responseType = responseType, data = data}
log('state', state)
table.insert(states, state)


And this is from Logs:

Code:
Test 15.08.2018 17:46:04
* arg: 1
 * string: responseType
* arg: 2
 * string: outputsState

Test 15.08.2018 17:46:04
* arg: 1
 * string: state
* arg: 2
 * table:
  [value]
   * string: outputsState
  [data]
   * string: ��

Test 15.08.2018 17:46:04
* arg: 1
 * string: responseType
* arg: 2
 * string: inputsState

Test 15.08.2018 17:46:04
* arg: 1
 * string: state
* arg: 2
 * table:
  [value]
   * string: inputsState
  [data]
   * string: ��

It looks like in this table it is not possible to add responseType property because it is not visible. Or I cannot type property with a capital letter. It is strange because in cmd table I am using such property so it should be possible.

Also such situation is very strange:

Code:
local states = satel:getStates()
log(states[1], states[2])
log(states[2])


Logs:

Code:
Test 15.08.2018 18:11:56
* arg: 1
 * table:
  [name]
   * string: outputsState
  [data]
   * string: ��

Test 15.08.2018 18:11:56
* table:
[name]
 * string: inputsState
[data]
 * string: ��


Yesterday I've received this LM and it has firmware 20180523. So maybe this is the case?

Aha, it looks that when in the table there is some binary/hex value then log() function can cause some strange behaviours because when I've changed data to some simple string print is appropriate.
Done is better than perfect
Reply


Messages In This Thread
Strange thing in Lua - by buuuudzik - 15.08.2018, 15:51
RE: Strange thing in Lua - by buuuudzik - 30.01.2019, 08:43
RE: Strange thing in Lua - by admin - 30.01.2019, 08:52
RE: Strange thing in Lua - by buuuudzik - 30.01.2019, 09:13

Forum Jump: