home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / dba1186.zip / NAMER2.PRG < prev    next >
Text File  |  1986-10-06  |  2KB  |  60 lines

  1.  
  2. ** Code for naming the day of the week from the calendar date **
  3. * namer2.prg
  4. * For use with IBM PC/XT/AT and compatibles running dBASE II
  5. * Assumes that following assembly routine has been poked into RAM
  6. * The namer assembly code reserves addresses F010 through F034
  7. * Decimal Addresses (61456-61492)
  8. *
  9. * The pokes below can be poked into RAM at the beginning of the
  10. * application and called at any time after that.  You must,
  11. * however, be careful not to poke anything on top of it.
  12. *
  13. erase
  14. set colon off
  15. set talk off
  16. poke 61456,180,42,205,33,81,82,139,14,48,240,139,22,50,240,180,43,;
  17. 205,33,180,42,205,33,162,52,240,90,89,180,43,205,33,195
  18. *
  19. * this input routine is for demonstration only. It has no error checking
  20. * on valid date entry.
  21. do while t
  22.   erase
  23.   store "        " to m::date
  24.   @ 10,10 get m::date
  25.   read
  26.   if m::date="  "
  27.     return
  28.   endif
  29.   * M::DATE is used to pass the target date into the routine and
  30.   * will be released after the routine.  Only "Nameday" is passed
  31.   * back. You must validate the M::DATE before calling this
  32.   * routine.
  33.   *
  34.   * If you poke the routine above into RAM at the beginning of
  35.   * your application, include the code following in your running
  36.   * code.
  37.   * NOTE:  This assumes your routine gets dates in the format
  38.   * "MM/DD/YY".  If you get dates in another format, just make
  39.   * the necessary adjustments in the initialization of the passed
  40.   * variables.
  41.   *
  42.   poke 61490,VAL($(M::DATE,4,2)),VAL($(M::DATE,1,2))
  43.   poke 61488,((VAL($(M::DATE,7,2))+1900)-1792),7
  44.   store " " to m::p
  45.   set call to 61456
  46.   call m::p
  47.   stor $("Sunday    .Monday    .Tuesday   .Wednesday .Thursday  .Friday    ."+;
  48.   "Saturday  .",(PEEK(61492)*11)+1,9) TO dayname
  49.   @ 14,10 say "Day of Week is " + dayname
  50.   release all like M::*
  51.   wait
  52. enddo
  53.  (61456-61492)
  54. *
  55. * The pokes below can be poked into RAM at the beginning of the
  56. * application and called at any time after that.  You must,
  57. * however, be careful not to poke anything on top of it.
  58. *
  59. erase
  60. set c