Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!brutus.cs.uiuc.edu!psuvax1!psuvm!cxt105 From: CXT105@PSUVM.BITNET (Christopher Tate) Newsgroups: comp.sys.mac.programmer Subject: Re: Random Message-ID: <89331.141717CXT105@PSUVM.BITNET> Date: 27 Nov 89 19:17:17 GMT References: <1989Nov26.011221.18046@ccu.umanitoba.ca> Organization: Penn State University Lines: 27 In article <1989Nov26.011221.18046@ccu.umanitoba.ca>, umcarls9@ccu.umanitoba.ca says: >I have the following in LightspeedC 3.02 > >long int ltime; > int number; > > GetDateTime(<ime); > randSeed=ltime; > number=Random(); > >Everything compiles fine, but when I run, the system comes up with a >bomb box ID 12 when it trys to do the number=Random();. I've even >tried it with just that line, and left randSeed set to its default >and it still bombs. >What am I doing wrong??? Before you can call Random(), you _must_ call InitGraf(&thePort). This sets up the random number generator. ------- Christopher Tate | "And as I watch the drops of rain | Weave their weary paths and die, cxt105@psuvm.psu.edu | I know that I am like the rain; {...}!psuvax1!psuvm.bitnet!cxt105 | There but for the grace of you go I." cxt105@psuvm.bitnet | -- Simon & Garfunkle