Threading....

Chipp Walters chipp at chipp.com
Wed Jan 2 22:22:00 EST 2002


steve,

Geoff Canyon answered this in an earlier post:

At 3:19 PM -0500 12/18/01, Shari wrote:

>Is it possible to have handlers share time? So that when it is idle, the
second handler runs?

>

>I have a very lengthy handler, that does certain things, calls other
handlers, and they in turn call other handlers. This sets up the data for
the user.

>

>As it takes more than a few seconds, I've created things for the user to
"do" while waiting.

One way to accomplish something like this is to break the setup task into
individual steps (the smaller the better) and then do something like:

global gSetupDone

on setup

put false into gSetupDone

doSetupStep 1

end setup

on doSetupStep pWhichStep

switch pWhichStep

case 1

blah blah

break

case 2

blah blah

break

...

case 32 -- last step

put true into gSetupDone

end switch

if not gSetupDone then

send ("doSetupStep" && (pWhichStep + 1)) to me in 1 millisecond

end if

end doSetupStep

What this will do is process your setup just about as fast as if it were all
done at once, but automatically put the process on hold for anything the
user does. Note that you can't break a task up any way you like -- each time
through the doSetupStep is a different execution, so local variables are
lost, loops or branches that go across the separate cases would fail, etc.

You should try to break the setup task into steps that will take no more
than .1 seconds each on a medium-speed computer. That way the user will
never feel that the system is unresponsive.

regards,

Geoff

_______________________________________________

metacard mailing list

metacard at lists.runrev.com

http://lists.runrev.com/mailman/listinfo/metacard

  -----Original Message-----
  From: use-revolution-admin at lists.runrev.com
[mailto:use-revolution-admin at lists.runrev.com]On Behalf Of steve lu
  Sent: Wednesday, January 02, 2002 4:41 PM
  To: use-revolution at lists.runrev.com
  Subject: Threading....


  Hi,

  Is there a way of controlling threading within RunRev authoring
environment?
  Can I create a new thread of execution or "pause" or "disable" a current
  running thread?

  I know VB.Net has these features which are very useful for creating
  background processes.

  Thanks,

  Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.runrev.com/pipermail/use-livecode/attachments/20020102/4c6ba99e/attachment.html>


More information about the use-livecode mailing list