home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / QBAS / PBC22B.ZIP / PBC$BAS.ZIP / WEEKDAY1.BAS < prev    next >
BASIC Source File  |  1993-04-15  |  1KB  |  25 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |        PBClone  Copyright (c) 1990-1993  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.