Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!ucdavis!iris!lim From: lim@iris.ucdavis.edu (Lloyd Lim) Newsgroups: comp.sys.mac.programmer Subject: Re: Testing for System 7 Message-ID: <9235@ucdavis.ucdavis.edu> Date: 29 Jun 91 08:54:41 GMT References: <1991Jun27.125511.19565@runx.oz.au> <54449@apple.Apple.COM> <1991Jun29.040825.12123@ux1.cso.uiuc.edu> Sender: usenet@ucdavis.ucdavis.edu Reply-To: lim@iris.ucdavis.edu (Lloyd Lim) Distribution: na Organization: U.C. Davis - Department of Electrical Engineering and Computer Science Lines: 42 In article <1991Jun29.040825.12123@ux1.cso.uiuc.edu> resnick@cogsci.uiuc.edu (Pete Resnick) writes: >davids@mondo.engin.umich.edu (David Snearline) writes: > >>Except that you would have to check the version of the system to see >>if _Gestalt exists... :-) > >No, no, no. Very bad. Check for the existence of the _Gestalt trap >by looking to see if it is in the trap table using NGetTrapAddress. You >*never* need to look at the version number of the operating system. Careful. Never is a strong word. You're correct about checking for Gestalt (BTW, there's a new version of TrapAvailable in IM VI for those who don't already know). There are a few cases where you do have to check version numbers. Here's the ones I came up with after a quick scan through my code. 1) If your app only runs on System 6.0.x and above, you obviously need to check this. If you assume System 6.0.x when programming, there's just too much stuff to individually check. 2) You can't call MultiFinder in versions 0x04FF and earlier with a sleep value greater than 50. This is documented. 3) MultiFinder doesn't call SystemTask when the system is sleeping which means you have to restrict your sleep values in System 6.0.x too. This bug is supposedly fixed in System 7. (I haven't checked yet.) I've mentioned this before on the net but I haven't seen it in print. 4) In System 6.0.3, the size of the left margin of menus changed. This can affect the appearance of popup menus. This wasn't documented but was acknowledged here on the net after people started complaining about it not being documented. I don't know any better ways to check for the above besides version numbers. If anyone has any suggestions, I'll be glad to change my code. +++ Lloyd Lim Internet: lim@iris.eecs.ucdavis.edu America Online: LimUnltd Compuserve: 72647,660 US Mail: 215 Lysle Leach Hall, U.C. Davis, Davis, CA 95616