Logic Machine Forum
Simple script - 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: Simple script (/showthread.php?tid=3725)



Simple script - tomnord - 03.12.2021

Hello. so, my head is hurting at the moment. Who won't this script work?
the tag "screensUP" returns nil.


I was thinking perhaps it could be a missmatch with datatypes, but the if statement  should at least return false?
Code:
now=os.date('*t')
screens = grp.getvalue('32/1/15') --DT 9
log(screens)

if screens == now.hour then
  log('OK')
  screensUp = true
else
  screensUp = false
end

grp.checkwrite('7/3/0', screensUp)
log('Screens UP', screensUP)



RE: Simple script - admin - 03.12.2021

Variables are case-sensitive, you have screensUp and screensUP. Use underscores and all lowercase letters to prevent such issues.


RE: Simple script - tomnord - 03.12.2021

(03.12.2021, 07:07)admin Wrote: Variables are case-sensitive, you have screensUp and screensUP. Use underscores and all lowercase letters to prevent such issues.

Well, that was embarrassing. I read through the whole thing several times and missed that..... Sometimes a second set of eyes are needed. Thanx.