home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / vms / 21833 < prev    next >
Encoding:
Internet Message Format  |  1993-01-24  |  1.2 KB

  1. Path: sparky!uunet!spool.mu.edu!agate!ucbvax!LTUVAX.BITNET!DK75684
  2. From: DK75684@LTUVAX.BITNET
  3. Newsgroups: comp.os.vms
  4. Subject: Re:  Random Number.
  5. Message-ID: <01GTTFTU5GQQ90N717@LTUVAX.BITNET>
  6. Date: 22 Jan 93 16:18:46 GMT
  7. Sender: usenet@ucbvax.BERKELEY.EDU
  8. Organization: The Internet
  9. Lines: 33
  10.  
  11. In a January 22 letter I received, you wrote...
  12.  
  13.  
  14. >Is there an easy way to get a scaled random number into a DCL com file?
  15. >Say an integer between 0 and 1000 or something like that?  I had a look in
  16. >the manual, but didn't really even know where to start looking, so even a
  17. >pointer in that direction would be helpful.  Thanks.
  18. >
  19. >Greg.
  20. >
  21.  
  22.  
  23.  
  24.         I had a similar problem, I ended up looking at the 10th and 100th
  25. place of the system clock, and extracting it with a lexical.
  26.  
  27. Here is the engine of the procedure I wrote:
  28.  
  29. $time=f$time()
  30. $stringnum=f$extract(21,22,time)
  31. $num=f$integer(stringnum)
  32.  
  33.         Where num would be an integer between 0 and 99.  I think that I would
  34. then multiply it by, say, the 1's place in the seconds.  I think this will
  35. be sufficently random.
  36.  
  37.  
  38. David Kott:                                     Electrical Engineering Larvae.
  39.  
  40. Lawrence Technological University, Mi.          DK75684@LTUVAX.BITNET
  41.  
  42.  
  43.  
  44.