'********************************************************************* 'This routine puts the day of the week in the StatusBar. 'I'm sure it can be used for many other purposes. Anyways, 'If you find away to improve it, Please send me an E-mail 'timelord@zebra.net '********************************************************************* DECLARE FUNCTION WEEKDAY (mon%, day%, year%) as String mon% = val(left$(date$,2)) day% = val(mid$(date$,4,2)) year% = val(right$(date$, 4)) Create Form as QForm Caption = "The DAY is in the StatusBar" Create StatusBar as QStatusBar AddPanels "","","" Panel(0).Width=100 Panel(1).Width=100 Panel(2).Caption = WEEKDAY (mon%, day%, year%) End Create ShowModal End Create FUNCTION WEEKDAY (mon%, day%, year%) as String IF (year% MOD 400 = 0) OR (year% MOD 4 = 0) AND (year% MOD 100 <> 0) THEN Leap% = 1 ELSE Leap% = 0 END IF DTmp% = (5 + Leap%) MOD 7 FOR MTmp% = 1 TO mon%: Ofs% = Ofs% + days% SELECT CASE MTmp% CASE 2 days% = 28 + Leap% CASE 4, 6, 9, 11 days% = 30 CASE ELSE days% = 31 END SELECT NEXT MTmp% IF day% <= days% THEN d% = (DTmp% + Ofs% + day% - 1) MOD 7 END IF d$ = "Sunday Monday Tuesday WednesdayThursday Friday Saturday " WEEKDAY = MID$(d$, d% * 9 + 1, 9) END FUNCTION