Strange thing in Lua - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Strange thing in Lua (/showthread.php?tid=1536) |
Strange thing in Lua - buuuudzik - 15.08.2018 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 And this is from Logs: Code: Test 15.08.2018 17:46:04 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() Logs: Code: Test 15.08.2018 18:11:56 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. RE: Strange thing in Lua - buuuudzik - 30.01.2019 I've found another similar situation: I have a custom library 'user.blinds' and when all functions in this library are global then when I require this library in some script I have an access to function dayScene. But after changing a few functions in this library to local variables but not dayScene then in script I cannot reach this function. Only when I do such thing: Code: -- GLOBALS in 'user.blinds' And then in script I can reach dayscene function but not dayScene so I see that when there are some local variables in global scope of module then probably all variables are indexed and then camelCase is unfortunately dropped. RE: Strange thing in Lua - admin - 30.01.2019 You can use loghex() for binary data but then all strings will be converted to hex which is not convenient if you mix both readable and binary data. As for user library, please provide the source and full test case. RE: Strange thing in Lua - buuuudzik - 30.01.2019 I don't use in this situation hex, I have only a problem with camelCase noted variables from module. |