home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.vms
- Path: sparky!uunet!gatech!udel!sbcs.sunysb.edu!insti!news
- From: LANDSBERG@sbhep2.phy.sunysb.edu (Greg Landsberg)
- Subject: Re: A random number
- In-Reply-To: sands@ccu1.aukuni.ac.nz's message of Thu, 21 Jan 1993 04:18:13 GMT
- Message-ID: <C183sC.KA4@max.physics.sunysb.edu>
- Sender: news@max.physics.sunysb.edu (News Administration)
- Nntp-Posting-Host: sbhepm
- Organization: SUNY at Stony Brook
- References: <1993Jan21.041813.20307@ccu1.aukuni.ac.nz>
- Date: Thu, 21 Jan 1993 21:31:24 GMT
- X-News-Reader: VMS NEWS 1.20
- Lines: 27
-
- In <1993Jan21.041813.20307@ccu1.aukuni.ac.nz> sands@ccu1.aukuni.ac.nz writes:
-
- > Is there an easy way to get a scaled random number into a DCL com file?
- > Say an integer between 0 and 1000 or something like that? I had a look in
- > the manual, but didn't really even know where to start looking, so even a
- > pointer in that direction would be helpful. Thanks.
- >
- > Greg.
- >
- > --
- > Greg Sands. | Department of Engineering Science
- > ----------- | University of Auckland
- > g.sands@aukuni.ac.nz | New Zealand.
-
-
- Well, if you don't want this number to be generated TOO frequently, why
- don't you just use the hundred's fraction of second for the current time as
- returned via F$TIME() call. It'll give you more or less random
- (pseudorandom) integer in the range from 0 to 99. You can generate another
- one and use the least significant digit in order to extend the range to
- 1000.
-
- Hope it'll help!
-
- Cheers,
-
- Greg
-