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.

Simple script
#1
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)
Reply
#2
Variables are case-sensitive, you have screensUp and screensUP. Use underscores and all lowercase letters to prevent such issues.
Reply
#3
(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.
Reply


Forum Jump: