home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!jvnc.net!netnews.upenn.edu!netnews.noc.drexel.edu!king.mcs.drexel.edu!queen.mcs.drexel.edu!urritche
- From: urritche@mcs.drexel.edu (Ralph Paul Ritchey)
- Newsgroups: comp.sys.mac.programmer
- Subject: Inside Mac VI: Time Manager code bugs?
- Message-ID: <1992Nov22.032228.16707@mcs.drexel.edu>
- Date: 22 Nov 92 03:22:28 GMT
- Sender: urritche@mcs.drexel.edu (Ralph Paul Ritchey)
- Organization: Drexel University
- Lines: 85
-
- Netters:
-
- All I want to do is install some code that needs to run periodically
- in my application. The Time Manager is ideal for this (I need finer
- resolution than using the VBL Manager). I tried using the code from
- IM VI, pages 23-12 to 23-14. It didn't work, so I decided to try
- the code all by itself in some little rinky dink program. It doesn't
- work. I've had all sorts of problems running which range from:
- total system freeze, applications quitting, and my IIci shutting
- down, to the mouse freezing in place. If the program doesnUt totally
- crash, I get either a BAD ADDRESS error or BUS ERROR from Think
- Pasca (version 4.0.1). What is the problem? I'm running system 7.0
- with tuneup on a IIci with 8megs internal memory. Here is the code
- as I have it:
-
- program test;
-
-
-
- uses
- timer;
-
- type
- tminfo = record
- atmtask: tmtask;
- tmwakeup: longint;
- tmreserved: longint;
- tmrefcon: longint;
- end;
- tminfoptr = ^tminfo;
-
- var
- i: integer;
-
- function gettminfo: tminfoptr;
- inline
- $2e89;
-
- procedure mytask;
- var
- olda5: longint;
- recptr: tminfoptr;
- mydelay: longint;
- begin
- recptr := gettminfo;
- olda5 := seta5(recptr^.tmrefcon);
- mydelay := 2000;
- i := i + 1;
- writeln('printing to the screen....', i);
- olda5 := seta5(olda5);
- primetime(qelemptr(recPtr), mydelay);
- end;
-
- procedure installTMTask;
- var
- mytminfo: tminfo;
- mydelay: longint;
- begin
- mydelay := 2000;
- mytminfo.atmtask.tmaddr := @mytask;
- mytminfo.tmwakeup := 0;
- mytminfo.tmreserved := 0;
- mytminfo.tmrefcon := setcurrenta5;
- insxtime(@mytminfo);
- primetime(@mytminfo, mydelay);
- end;
-
-
-
- begin
- i := 0;
- showtext;
- installtmtask;
- repeat
- until (i = 40);
-
- end.
-
-
-
- Thanks in advance for the help!
-
- Ralph Ritchey
- urritche@mcs.drexel.edu
- @king.mcs.drexel.edu
-