Page 1 of 1

Managing multiple lock/unlock screen

Posted: Tue May 30, 2017 10:48 pm
by jmburnod
Managing lock screen

To avoid a lock/unlock screen not expected I use this

Hi All,
To avoid a lock/unlock screen not expected I use this

Code: Select all

on mymessage
  if not the lockScreen then
      put 0 into tLS 
      lock screen
   else
      put 1 into tLS
   end if
....
....
  if tLS = 0 then  unlock screen
end myMessage
Is there a more elegant way to do that ?
Best regards
Jean-Marc

Re: Managing multiple lock/unlock screen

Posted: Wed May 31, 2017 1:25 pm
by [-hh]
Depends upon what is 'elegant' ...
Here is an at least shorter variant.

Code: Select all

on myMessage
  put not the lockscreen into tLS
  if tLS then lock screen
  ....
  if tLS then unlock screen
end myMessage

Re: Managing multiple lock/unlock screen

Posted: Wed May 31, 2017 4:07 pm
by jmburnod
Hi Herman,
Thanks again
Your variant is more elegant than mine for me.
One criteria is indeed the num of lines
for the same goal.
Jean-Marc

Re: Managing multiple lock/unlock screen

Posted: Thu Jun 01, 2017 11:10 pm
by makeshyft
LOL.....i still don't understand this kind of syntax in LC. makes my eye twitch.