From: send.email.to.lisch.at.tempest-sw.com@nojunkmail (Ray Lischner) Subject: Re: ***Random numbers!?!*** Date: 21 May 1999 00:00:00 GMT Message-ID: <3746d026.21941850@news.proaxis.com> Content-Transfer-Encoding: 7bit References: <7hsc7t$nvs$1@news3.saix.net> <3742b70e@news> <37430e87.11451105@netnews.worldnet.att.net> <3743c991@news> <3745f6ae.1522448@newshost.uwo.ca> <37455ce1@news> Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsabuse@remarQ.com X-Trace: 927322272 XN.PZC.IP9B83CEA3C usenet52.supernews.com Organization: Tempest Software, Inc., Corvallis, Oregon Mime-Version: 1.0 Newsgroups: comp.lang.pascal.delphi.misc On Fri, 21 May 1999 23:55:45 +1000, "Dr J D Collins" wrote: >> Duncan Murdoch wrote: >> One other translation error: you should use "Random", not >> "Random(1)". The latter always gives 0. > >Actually not true. Random(1) and Random are identical as shown by the >following extract from Delphi help: > >The Random function returns a random number within the range 0 <= X < >Range. >If Range is not specified, the result is a real-type random number >within the range 0 <= X < 1." Duncan is correct. The documentation is poorly written. Change "number" to "integer" in the first sentence: If you call Random with one argument, the Range argument must be an integer, and the Random function returns a random integer in the range 0 <= X < Range. If you call Random with no arguments, the result is an Extended value in the range 0 <= X < 1. -- Ray Lischner (http://www.tempest-sw.com/) author of Delphi in a Nutshell