Managing multiple lock/unlock screen

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2423
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Managing multiple lock/unlock screen

Post by jmburnod » Tue May 30, 2017 10:48 pm

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

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2234
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Managing multiple lock/unlock screen

Post by [-hh] » Wed May 31, 2017 1:25 pm

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
shiftLock happens

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2423
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Managing multiple lock/unlock screen

Post by jmburnod » Wed May 31, 2017 4:07 pm

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

makeshyft
Posts: 187
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Re: Managing multiple lock/unlock screen

Post by makeshyft » Thu Jun 01, 2017 11:10 pm

LOL.....i still don't understand this kind of syntax in LC. makes my eye twitch.
Tom @
http://www.makeshyft.com
---------------------------------
Changing the Future, Today!

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”