Path: utzoo!utgpu!water!watmath!clyde!att-cb!osu-cis!tut.cis.ohio-state.edu!rutgers!mailrus!ames!umd5!uvaarpa!mcnc!rti!sas!toebes From: toebes@sas.UUCP (John Toebes) Newsgroups: comp.sys.amiga.tech Subject: Re: Friendly waiting (not hogging the CPU) Message-ID: <457@sas.UUCP> Date: 17 Apr 88 14:19:05 GMT References: <8804150348.AA26966@jade.berkeley.edu> Reply-To: toebes@sas.UUCP (John Toebes) Organization: SAS Institute Inc, Cary NC Lines: 30 In article <8804150348.AA26966@jade.berkeley.edu> SLMYQ@USU.BITNET writes: >> PS: If Delay() does indeed cause damage to disks if a 0 is passed >> wouldn't it make sense to either not use it or encapuslate >> it within a procedure which ensures a non-zero input? > >That would be great. In fact, if the big compiler compainies wanted to make >it easy, they would just add some code into the stub for Delay() to check >the input for 0. However, I understand that the stubs are created >automatically, and it might not be that easy. > > Bryan Ford (SLMYQ@USU.BITNET) Actually, Commodore supplies the stubs in Amiga.LIB. With 4.0, we give you the ability to go straight through to AmigaDos without the stub by loading the registers directly and calling as if you were coding in assembler. Suggestion for a good project for someone starting out: Write a simple program that 'SetFunction's Delay and immediately returns for values of 0 that are passed to it. It certainly would halt a lot of crashes from non-well behaved programs. (No malice intended) On the original subject, I find that INTUITICKS is an excellent way to do processing only when your window is active. You get the 'ticks' at a regular interval which is usually enough to update the screen. They are not for every application but they do fit quite a lot of them. Besides, they are much simpler to use than the timer device. /*---------------------All standard Disclaimers apply---------------------*/ /*----Working for but not officially representing SAS or Lattice Inc.-----*/ /*----John A. Toebes, VIII usenet:...!mcnc!rti!sas!toebes-----*/ /*------------------------------------------------------------------------*/