updating progress to user during long handler

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: updating progress to user during long handler

Phil Davis-5
Here is an inelegant but effective way to handle an unknown number of
nested lockScreens:

put 0 into x
repeat until the lockScreen is false
     unlock screen
     add 1 to x
end repeat

-- put your update indicator code here

repeat x times
     lock screen
end repeat


Then you don't have to search far and wide for the culprits. And you
leave the lockScreen environment as you found it.

Best -
Phil Davis



On 2/26/16 10:48 PM, jameshale wrote:

> Well I thought I should have a look given these comments.
> I went through every GLX script I could find looking for lockscreens - none.
> I then went through all my scripts in my main stack, the card scripts of the
> opening card as well as all library stacks I am calling.
> Every lockscreen was paired (lock/unlock) within the handler it was located.
> None of these handlers, BTW, were being called during the opening sequence.
>
> Just to be sure I also added an if lockscreen = true then breakpoint at a
> couple of my progress points.
>
> Launching the app it proceeded as wanted, updating the splash screen with
> progress reports until the screen displayed.
> None of the lockscreen checks fired, indicating to me that there were
> actually no lockscreens were in effect during the startup.
>
> So, I do not think there will be a problem as has been suggested.
> I also can't explain why setting the lockscreen to false in the Splash stack
> makes things work.
>
> As an aside when reading the dictionary on lockscreen it states that its
> setting has no effect in the IDE with script debug enabled.
> I have script debug mode enabled.
> I am also doing all this testing in the IDE.
> If lockscreen has no effect in the IDE under these circumstances then why
> does setting the lockscreen to false allow things to work?
>
> Curious, no?
>
>
>
> --
> View this message in context: http://runtime-revolution.278305.n4.nabble.com/updating-progress-to-user-during-long-handler-tp4701326p4701572.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>

--
Phil Davis


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: updating progress to user during long handler

Kay C Lan
In reply to this post by jameshale
On Sat, Feb 27, 2016 at 2:48 PM, jameshale <[hidden email]> wrote:

>
> As an aside when reading the dictionary on lockscreen it states that its
> setting has no effect in the IDE with script debug enabled.
> I have script debug mode enabled.
> I am also doing all this testing in the IDE.
> If lockscreen has no effect in the IDE under these circumstances then why
> does setting the lockscreen to false allow things to work?
>
> Curious, no?
>
I think what that means to say is that you are not in Debug Mode until
you actually hit a breakpoint and you step through your code, stepping
onto lock screen will have no effect. It's pretty easy to test:

Run once then comment out the breakpoint and run again.

New stack, 1 button, 1 field. In the btn:

on mouseUp
   put empty into x
   repeat with x = 1 to 500
      put x into fld 1
   end repeat

   put empty into fld 1
   wait 1 sec
   --breakpoint
   lock screen
   repeat with x = 1 to 5000 --yes 5000*
      put x into fld 1
   end repeat
end mouseUp

* Just to demonstrate how unlocking the screen slows things down... A LOT.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: updating progress to user during long handler

jameshale
Thanks for the inelegant solution Phil.
Although given I didn't find any to unlock (despite the unlock screen getting things to work) I trust I do not need it.
Thanks Kay for the interpretation of the dictionary entry.
Makes perfect sense.
Opportunity for an edit to the entry I guess.

We can probably put this thread to bed now.
Thank you all for your help
12