home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / vms / 21648 < prev    next >
Encoding:
Text File  |  1993-01-21  |  1.5 KB  |  42 lines

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