home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!agate!ucbvax!LTUVAX.BITNET!DK75684
- From: DK75684@LTUVAX.BITNET
- Newsgroups: comp.os.vms
- Subject: Re: Random Number.
- Message-ID: <01GTTFTU5GQQ90N717@LTUVAX.BITNET>
- Date: 22 Jan 93 16:18:46 GMT
- Sender: usenet@ucbvax.BERKELEY.EDU
- Organization: The Internet
- Lines: 33
-
- In a January 22 letter I received, you wrote...
-
-
- >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.
- >
-
-
-
- I had a similar problem, I ended up looking at the 10th and 100th
- place of the system clock, and extracting it with a lexical.
-
- Here is the engine of the procedure I wrote:
-
- $time=f$time()
- $stringnum=f$extract(21,22,time)
- $num=f$integer(stringnum)
-
- Where num would be an integer between 0 and 99. I think that I would
- then multiply it by, say, the 1's place in the seconds. I think this will
- be sufficently random.
-
-
- David Kott: Electrical Engineering Larvae.
-
- Lawrence Technological University, Mi. DK75684@LTUVAX.BITNET
-
-
-
-