home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.vms
- Path: sparky!uunet!noc.near.net!ileaf!leafusa!bcking
- From: bcking@HQ.Ileaf.COM (Christine King)
- Subject: Re: A random number
- Message-ID: <C17pFH.3LC@HQ.Ileaf.COM>
- Sender: usenet@HQ.Ileaf.COM
- Nntp-Posting-Host: natasha
- Organization: Interleaf, Inc.
- References: <1993Jan21.041813.20307@ccu1.aukuni.ac.nz>
- Date: Thu, 21 Jan 1993 16:21:16 GMT
- Lines: 20
-
- In article <1993Jan21.041813.20307@ccu1.aukuni.ac.nz> g.sands@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?
-
- You could use F$TIME() to get a fairly random looking number. How
- about this:
-
- $ rno = f$element(1,".",f$time()) !..random 00-99
-
- This gives you the hundredths part of "21-JAN-1993 11:04:20.66". If
- you want another digit, pick the lower digit out of the seconds.
- Remember that the hours:minutes:seconds don't give you a full range of
- decimal numbers.
-
- Hope this helps.
- --
- Christine King, bcking@ileaf.com
- Interleaf, Inc. | My opinions are not | "Time is like that,
- 9 Hillside Avenue | necessarily those of | except for the cannon
- Waltham MA 02154 USA | Interleaf, Inc. | and the donut." -Dilbert
-