How to sort out this

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: How to sort out this

Post by FourthWorld » Wed Jul 25, 2018 4:14 pm

"Not Responding" is not, as you've found, "Not Working". It's merely the OS reporting that theapp isn't surrendering enough of its event loop for the OS to feel comfortable about the interaction.

In most cases it's actually fine, but the OS reporting that is disconcerting to users, so it isa bug, one the LC team is working on.

They may have addressed it. Have you tried the latest build?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

alemrantareq
Posts: 203
Joined: Wed Jul 23, 2008 8:46 am

Re: How to sort out this

Post by alemrantareq » Wed Jul 25, 2018 8:20 pm

hi Richard,

yes I'm using the latest build of LC community version :)
also glad to know LC team is working to fix the 'Not Responding' thing while it goes through a large process !!

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: How to sort out this

Post by SparkOut » Wed Jul 25, 2018 9:00 pm

Nah. The answer is, as always was and probably ever will be, include within the repeat loop the line

Code: Select all

wait 0 with messages
This gives the engine a near zero duration pause, to take care of housekeeping processes and prevent the "not responding" appearance.

alemrantareq
Posts: 203
Joined: Wed Jul 23, 2008 8:46 am

Re: How to sort out this

Post by alemrantareq » Wed Jul 25, 2018 9:11 pm

hi SparkOut,

will generate a new standalone with your idea for sure. thanks man :D

rkriesel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 118
Joined: Thu Apr 13, 2006 6:25 pm

Re: How to sort out this

Post by rkriesel » Wed Jul 25, 2018 9:36 pm

alemrantareq wrote:
Wed Jul 25, 2018 6:13 am
hi rkriesel,
...
So bwmilby's script wins the race ;)

Despite that, you and bwmilby both won my heart :D
Here's a version of bwmilby's handler that's a little simpler (because it uses booleans instead of counters) and therefore a little easier to read and a little faster (a few percent). And it showcases the new "difference" command.

Code: Select all

function singletonKeys tLines, pItemDelimiter -- tLines is a return-delimited list
   local tKeys, tDuplicatedKeys
   set the itemDelimiter to pItemDelimiter
   repeat for each line tLine in tLines
      get item 1 of tLine
      if tKeys[ it ] then
         put "true" into tDuplicatedKeys[ it ]
      else
         put "true" into tKeys[ it ]
      end if
   end repeat
   
   split tLines with return and pItemDelimiter
   difference tLines with tDuplicatedKeys
   combine tLines with return and pItemDelimiter
   return tLines
end singletonKeys
You're welcome, alemrantareq. Happy coding.
-- Dick

alemrantareq
Posts: 203
Joined: Wed Jul 23, 2008 8:46 am

Re: How to sort out this

Post by alemrantareq » Thu Jul 26, 2018 7:47 am

hi Dick,

just tried out the new code you made for me. Seems now much faster than the previous one, yet still couldn't bid bwmilby's code. Just took 1 sec more than his code ;)

Well Done dear rkriesel and bwmilby, the effort you both given for me will never be forgotten Image

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”