home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mac / programm / 18764 < prev    next >
Encoding:
Internet Message Format  |  1992-11-21  |  2.2 KB

  1. 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
  2. From: urritche@mcs.drexel.edu (Ralph Paul Ritchey)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Inside Mac VI: Time Manager code bugs?
  5. Message-ID: <1992Nov22.032228.16707@mcs.drexel.edu>
  6. Date: 22 Nov 92 03:22:28 GMT
  7. Sender: urritche@mcs.drexel.edu (Ralph Paul Ritchey)
  8. Organization: Drexel University
  9. Lines: 85
  10.  
  11. Netters:
  12.  
  13. All I want to do is install some code that needs to run periodically
  14. in my application.  The Time Manager is ideal for this (I need finer
  15. resolution than using the VBL Manager).  I tried using the code from
  16. IM VI, pages 23-12 to 23-14.  It didn't work, so I decided to try
  17. the code all by itself in some little rinky dink program.  It doesn't
  18. work.  I've had all sorts of problems running which range from:
  19. total system freeze, applications quitting, and my IIci shutting
  20. down, to the mouse freezing in place.  If the program doesnUt totally
  21. crash, I get either a BAD ADDRESS error or BUS ERROR from Think
  22. Pasca (version 4.0.1).  What is the problem?  I'm running system 7.0 
  23. with tuneup on a IIci with 8megs internal memory.  Here is the code 
  24. as I have it:
  25.  
  26. program test;
  27.  
  28.  
  29.  
  30.  uses
  31.   timer;
  32.  
  33.  type
  34.   tminfo = record
  35.     atmtask: tmtask;
  36.     tmwakeup: longint;
  37.     tmreserved: longint;
  38.     tmrefcon: longint;
  39.    end;
  40.   tminfoptr = ^tminfo;
  41.  
  42.  var
  43.   i: integer;
  44.  
  45.  function gettminfo: tminfoptr;
  46.  inline
  47.   $2e89;
  48.  
  49.  procedure mytask;
  50.   var
  51.    olda5: longint;
  52.    recptr: tminfoptr;
  53.    mydelay: longint;
  54.  begin
  55.   recptr := gettminfo;
  56.   olda5 := seta5(recptr^.tmrefcon);
  57.   mydelay := 2000;
  58.   i := i + 1;
  59.   writeln('printing to the screen....', i);
  60.   olda5 := seta5(olda5);
  61.   primetime(qelemptr(recPtr), mydelay);
  62.  end;
  63.  
  64.  procedure installTMTask;
  65.   var
  66.    mytminfo: tminfo;
  67.    mydelay: longint;
  68.  begin
  69.   mydelay := 2000;
  70.   mytminfo.atmtask.tmaddr := @mytask;
  71.   mytminfo.tmwakeup := 0;
  72.   mytminfo.tmreserved := 0;
  73.   mytminfo.tmrefcon := setcurrenta5;
  74.   insxtime(@mytminfo);
  75.   primetime(@mytminfo, mydelay);
  76.  end;
  77.  
  78.  
  79.  
  80. begin
  81.  i := 0;
  82.  showtext;
  83.  installtmtask;
  84.  repeat
  85.  until (i = 40);
  86.  
  87. end.
  88.  
  89.  
  90.  
  91. Thanks in advance for the help!
  92.  
  93. Ralph Ritchey
  94. urritche@mcs.drexel.edu
  95.     @king.mcs.drexel.edu
  96.