Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!comp.vuw.ac.nz!cavebbs!clear From: clear@cavebbs.gen.nz (Charlie Lear) Newsgroups: comp.lang.pascal Subject: Re: THINK Pascal on the Mac Message-ID: <1991Feb28.043110.4328@cavebbs.gen.nz> Date: 28 Feb 91 04:31:10 GMT References: <17150@milton.u.washington.edu> Organization: The Cave MegaBBS, Public Access Usenet, Wellington, NZ Lines: 16 In article <17150@milton.u.washington.edu> plague@milton.u.washington.edu (Jack Brown) writes: >I've got a problem. I need to be able to generate random integers between >1 and 100. These are for indexing arrays. Anyway, the problem is that when >I call the funciton 'random', I get integers between +-32767. It is simple >to scale these to provide numbers between 1 and 100, but I can't seem to get >integers out of them... Try putting the range after the random function, for example random(100) Works on most compilers. -- -------------------------------------------------------------------------- Charlie "The Bear" Lear | clear@cavebbs.gen.nz | Kawasaki Z750GT DoD#0221 The Cave MegaBBS +64 4 642260 V32 | PO Box 2009, Wellington, New Zealand --------------------------------------------------------------------------