home *** CD-ROM | disk | FTP | other *** search
/ The California Collection / TheCaliforniaCollection.cdr / his038 / qbints.lzh / NEWDATE.BAS < prev    next >
Encoding:
BASIC Source File  |  1989-04-23  |  1.6 KB  |  55 lines

  1. 'Sun  Apr 23, 1989   2:19:38 pm 
  2. '***********************************************************************
  3. 'This routine replaces DATE$ using plain English, with day of week.
  4. '***********************************************************************
  5. DECLARE FUNCTION newdate$ ()
  6. TYPE RegType
  7.      ax    AS INTEGER
  8.      bx    AS INTEGER
  9.      cx    AS INTEGER
  10.      dx    AS INTEGER
  11.      bp    AS INTEGER
  12.      si    AS INTEGER
  13.      di    AS INTEGER
  14.      flags AS INTEGER
  15. END TYPE
  16. DIM SHARED inregs AS RegType, outregs AS RegType
  17. DIM SHARED day$(7), month$(12)
  18.        
  19.      PRINT newdate$
  20.  
  21. FUNCTION newdate$
  22.      day$(0) = "Sunday"
  23.      day$(1) = "Monday"
  24.      day$(2) = "Tuesday"
  25.      day$(3) = "Wednesday"
  26.      day$(4) = "Thursday"
  27.      day$(5) = "Friday"
  28.      day$(6) = "Saturday"
  29.      month$(1) = "Jan"
  30.      month$(2) = "Feb"
  31.      month$(3) = "Mar"
  32.      month$(4) = "Apr"
  33.      month$(5) = "May"
  34.      month$(6) = "Jun"
  35.      month$(7) = "Jul"
  36.      month$(8) = "Aug"
  37.      month$(9) = "Sep"
  38.      month$(10) = "Oct"
  39.      month$(11) = "Nov"
  40.      month$(12) = "Dec"
  41.      t1 = &H2A00: t2 = 0: t3 = 0: t4 = 0
  42.      inregs.ax = t1: inregs.bx = t2: inregs.cx = t3: inregs.dx = t4
  43.      CALL interrupt(&H21, inregs, outregs)
  44.      t1 = outregs.ax: t2 = outregs.bx: t3 = outregs.cx: t4 = outregs.dx
  45.      day = t1 - ((FIX(t1 / 256)) * 256)
  46.      day$ = day$(day)
  47.      year = t3
  48.      year$ = LTRIM$(RTRIM$(STR$(year)))
  49.      month = FIX(t4 / 256)
  50.      month$ = month$(month)
  51.      date = t4 - (month * 256)
  52.      newdate$ = day$ + SPACE$(2) + month$ + STR$(date) + "," + STR$(year)
  53. END FUNCTION
  54.  
  55.