Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!bbn!apple!darin From: darin@Apple.COM (Darin Adler) Newsgroups: comp.sys.mac.programmer Subject: Re: Calling Random Message-ID: <1499@internal.Apple.COM> Date: 22 Apr 89 00:36:00 GMT References: <1055@mailrus.cc.umich.edu> Distribution: comp.sys.mac.programmer Organization: Apple Lines: 17 In article <1055@mailrus.cc.umich.edu> davidh@ronin.cc.umich.edu (David Hotchkiss) writes: > > I'm trying to write some simple simulation programs that involve making > calls to the random number generator. Whenever I try calling the Random > funtion, I get a Bus error. However, the stackpointer is still even. Random is a QuickDraw routine, so you must have an A5 world set up for QuickDraw globals, and call InitGraf before calling Random. This was a bug in the old "Insect" desk accessory by Burt Sloane. He used Random to choose a random place for the insect to climb down the screen, but didn't have QuickDraw globals in his insect code. He found the bug, but not before copies of the DA spread around most of the Mac community. -- Darin Adler, System Software Scapegoat, Apple Computer Internet: darin@Apple.com UUCP: {nsc,sun}!apple!darin