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

  1. Path: sparky!uunet!paladin.american.edu!gatech!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!spool.mu.edu!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!mcsun!sun4nl!ittpub.nl!david
  2. From: david@ittpub.nl (David P. Morgan)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: A random number
  5. Message-ID: <1993Jan21.152713.95@ittpub.nl>
  6. Date: 21 Jan 93 21:36:51 GMT
  7. References: <1993Jan21.041813.20307@ccu1.aukuni.ac.nz> <1993Jan21.015717.1@woods.ulowell.edu>
  8. Organization: ITT Publitec R+D BV, Amsterdam
  9. Lines: 19
  10.  
  11. In article <1993Jan21.015717.1@woods.ulowell.edu>, sabotkap@woods.ulowell.edu writes:
  12. > Greg Sands writes:
  13. > ->  Is there an easy way to get a scaled random number into a DCL com file? 
  14. > ->  Say an integer between 0 and 1000 or something like that?  I had a look in
  15. > ->  the manual, but didn't really even know where to start looking, so even a
  16. > ->  pointer in that direction would be helpful.  Thanks.
  17. > Try anonymous FTP to ACFCLUSTER.NYU.EDU in [.VMS] subdirectory.  RANDOM.COM
  18. > is an application entirely in DCL which should do what you want.
  19. The simplest thing to do is to take the hundredths and seconds from the
  20. current time. It's random enough!
  21.  
  22.     irand=f$integer(f$extract(21,2,f$time())+f$extract(18,2,f$time()))
  23.  
  24. --------------------------------------------------------------------------------
  25. David P. Morgan                        Internet: david@ittpub.nl        |ucannot
  26. ITT Publitec R+D BV                    UUCP:     ...!sun4nl!ittpub!david|readdis
  27. Amsterdam                              PSI:      020412905761212::DAVID |onavt52
  28.