home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / dos / prg / bas / hanlin3 / pbc30a / weekday1.bas < prev    next >
BASIC Source File  |  1994-03-13  |  1KB  |  25 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |        PBClone  Copyright (c) 1990-1994  Thomas G. Hanlin III        |
  4. '   |                                                                      |
  5. '   +----------------------------------------------------------------------+
  6.  
  7.    DECLARE FUNCTION AscM% (St$, BYVAL Posn%)
  8.    DECLARE SUB DateA2R (BYVAL MonthNr%, BYVAL DayNr%, BYVAL YearNr%, RelDate&)
  9.    DECLARE SUB DateS2N (MonthNr%, DayNr%, YearNr%, DateSt$)
  10.  
  11. SUB WeekDay1 (MonthNr%, DayNr%, YearNr%, DayName$)
  12.    IF MonthNr% < 1 OR DayNr% < 1 OR YearNr% < 0 THEN
  13.       DateS2N M%, D%, Y%, DATE$
  14.    ELSE
  15.       M% = MonthNr%
  16.       D% = DayNr%
  17.       Y% = YearNr%
  18.    END IF
  19.    DateA2R M%, D%, Y%, RelDate&
  20.    WeekDayNr% = CINT(RelDate& MOD 7&) + 1
  21.    Posn% = AscM("ADGKQVY" , WeekDayNr%) - 64
  22.    Length% = AscM("3346535", WeekDayNr%) - 48
  23.    DayName$ = MID$("SunMonTuesWednesThursFriSatur", Posn%, Length%) + "day"
  24. END SUB
  25.