<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4616.200" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=600232103-03012002><FONT face=Arial color=#0000ff
size=2>steve,</FONT></SPAN></DIV>
<DIV><SPAN class=600232103-03012002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=600232103-03012002><FONT face=Arial color=#0000ff size=2>Geoff
Canyon answered this in an earlier post:</FONT></SPAN></DIV>
<DIV><SPAN class=600232103-03012002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=600232103-03012002><FONT size=2>
<P>At 3:19 PM -0500 12/18/01, Shari wrote:</P>
<P>>Is it possible to have handlers share time? So that when it is idle, the
second handler runs?</P>
<P>></P>
<P>>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.</P>
<P>></P>
<P>>As it takes more than a few seconds, I've created things for the user to
"do" while waiting.</P>
<P>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:</P>
<P>global gSetupDone</P>
<P>on setup</P>
<P>put false into gSetupDone</P>
<P>doSetupStep 1</P>
<P>end setup</P>
<P>on doSetupStep pWhichStep</P>
<P>switch pWhichStep</P>
<P>case 1</P>
<P>blah blah</P>
<P>break</P>
<P>case 2</P>
<P>blah blah</P>
<P>break</P>
<P>...</P>
<P>case 32 -- last step</P>
<P>put true into gSetupDone</P>
<P>end switch</P>
<P>if not gSetupDone then </P>
<P>send ("doSetupStep" && (pWhichStep + 1)) to me in 1 millisecond</P>
<P>end if</P>
<P>end doSetupStep</P>
<P>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.</P>
<P>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.</P>
<P>regards,</P>
<P>Geoff</P>
<P>_______________________________________________</P>
<P>metacard mailing list</P>
<P>metacard@lists.runrev.com</P>
<P>http://lists.runrev.com/mailman/listinfo/metacard</P></FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B>
use-revolution-admin@lists.runrev.com
[mailto:use-revolution-admin@lists.runrev.com]<B>On Behalf Of </B>steve
lu<BR><B>Sent:</B> Wednesday, January 02, 2002 4:41 PM<BR><B>To:</B>
use-revolution@lists.runrev.com<BR><B>Subject:</B>
Threading....<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Is there a way of controlling threading
within RunRev authoring environment?</FONT></DIV>
<DIV><FONT face=Arial size=2>Can I create a new thread of execution or "pause"
or "disable" a current</FONT></DIV>
<DIV><FONT face=Arial size=2>running thread?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I know VB.Net has these features which are very
useful for creating</FONT></DIV>
<DIV><FONT face=Arial size=2>background processes.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Steve</FONT></DIV></BLOCKQUOTE></BODY></HTML>