Path: utzoo!utgpu!watmath!clyde!ima!bbn!apple!jmpdude From: jmpdude@Apple.COM (Mike Puckett) Newsgroups: comp.sys.mac.programmer Subject: Re: Time Manager -- please help! Message-ID: <22477@apple.Apple.COM> Date: 19 Dec 88 07:56:03 GMT References: <5363@boulder.Colorado.EDU> Organization: Apple Computer Inc, Cupertino, CA Lines: 22 In the source-code fragment that you provided, the only potential problem that I spotted was in your Time Manager task routine. The routines SetUpA5() and RestoreA5() will not (potentially) work correctly with the Time Manager because CurrentA5 may not be pointing to your application's globals when the Time Manager task gets called. This is especially true in a MultiFinder environment. So, what you need to do is make yourself a set of routines that will ensure that A5 is set up correctly when your task is called (this is what I had to do). The routines I have created are called, CacheA5(), BeginA5Swap(), and EndA5Swap(). CacheA5() is called in the main body of my program before a PrimeTime() call is made; what it does is to store the CurrentA5 value into a KNOWN (very important!) location. The jobs of BeginA5Swap() and EndA5Swap() are analogous to SetupA5() and RestoreA5(), except that they work with the KNOWN location of CacheA5() instead of CurrentA5 [See Tech. Notes: #180 and #208. Also, see the Programmer's Guide to MultiFinder.] By the way, before I sent this response, I tried your idea out [in MPW, using my A5 handler routines], and it works like I presume you want: every 1,000 ms (1 second) the current count is printed until the mouse button is clicked. Mike Puckett, jmpdude@apple.com