Page 4 of 4

Re: How to sort out this

Posted: Wed Jul 25, 2018 4:14 pm
by FourthWorld
"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?

Re: How to sort out this

Posted: Wed Jul 25, 2018 8:20 pm
by alemrantareq
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 !!

Re: How to sort out this

Posted: Wed Jul 25, 2018 9:00 pm
by SparkOut
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.

Re: How to sort out this

Posted: Wed Jul 25, 2018 9:11 pm
by alemrantareq
hi SparkOut,

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

Re: How to sort out this

Posted: Wed Jul 25, 2018 9:36 pm
by rkriesel
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

Re: How to sort out this

Posted: Thu Jul 26, 2018 7:47 am
by alemrantareq
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