home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / vms / 20765 < prev    next >
Encoding:
Internet Message Format  |  1993-01-11  |  2.1 KB

  1. Path: sparky!uunet!cs.utexas.edu!asuvax!ncar!noao!arizona!sunquest!spades.aces.com!gavron
  2. From: gavron@spades.aces.com (Ehud Gavron 602-570-2000 x. 2546)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: Implimenting "TOMORROW +1: 0:0" from an .EXE
  5. Message-ID: <11JAN199319201213@spades.aces.com>
  6. Date: 12 Jan 93 02:20:00 GMT
  7. References: <1993Jan11.153438.28624@magnus.acs.ohio-state.edu>
  8. Sender: news@cs.arizona.edu
  9. Reply-To: gavron@ACES.COM
  10. Organization: ACES Consulting Inc.
  11. Lines: 46
  12. News-Software: VAX/VMS VNEWS 1.4-b1
  13.  
  14. In article <1993Jan11.153438.28624@magnus.acs.ohio-state.edu>, pat@magnus.acs.ohio-state.edu (Patrick E Plaisted) writes...
  15. #I have the need to set an AST timer queue entry to fire at, in DCL
  16. #syntax, "TOMORROW +1:0:0".  I've looked through all the LIB$ routines,
  17. #as well as $bintim and $asctim.  Is there a simple way to get a
  18. #quadword time value set to this so I can stick it into $setimr?  
  19. #My only thoughts on how to do this are:   
  20. #  1. calculate the number of hours to midnight.
  21. #  2. calculate the number of minutes to midnight.
  22. #  3. calculate the number of seconds to midnight.
  23. #  4. use lib$cvt_to_internal_time to convert these values to
  24. #     delta time quadwords.
  25. #  5. use lib$add_times to add these values to a quadword containing the 
  26. #     current time.
  27. #  6. again using lib$add_times, add 1 hour to this value.
  28. #  7. finally, call $setimr with the quadword.
  29. #I think this approach should work, but am I missing something really 
  30. #obvious?  Is there an easier way to do this?
  31.  
  32.     1. Call SYS$GETTIM to get current time in ticks (10ns units)
  33.     2. Add 144,000,000 to this number 
  34.        24 hrs x 60 min  x 60 sec  x 100000 ns    144,000,000 ns/day
  35.                  -----     -----         ---- =
  36.                hr        min          sec
  37.     3. Use SYS$ASCTIM to get this in ascii format in the form
  38.        DD-MMM-YYYY HH:MM:SS.hh
  39.  
  40.     4. Insert in the 13th position of the string "01:00:00.00"
  41.     5. Call SYS$BINTIM
  42.  
  43.     (I may be off on the number in #2 but it looks right.  I'm
  44.      sure someone will rush to correct me if it isn't.)
  45.  
  46. #Thanks for all your help,
  47. #Pat
  48. #pat@magnus.acs.ohio-state.edu
  49.  
  50.     Ehud
  51.  
  52. --
  53. Ehud Gavron        (EG76)     
  54. gavron@vesta.sunquest.com
  55. Don't SANFORIZE me!!
  56.