BBS: Inland Empire Archive Date: 02-17-93 (16:10) Number: 256 From: MICHEL BERTLER Refer#: NONE To: RAYMOND KEITH Recvd: NO Subj: DAYS.BAS 2/2 Conf: (2) Quik_Bas

Part 2 of DAYS.BAS - continued from last message... month$(9, 1) = "September": month$(9, 2) = "30" month$(10, 1) = "October": month$(10, 2) = "31" month$(11, 1) = "November": month$(11, 2) = "30" month$(12, 1) = "December": month$(12, 2) = "31"DIMDayYearStarted$(14)' 1 = sunday and 7 = saturday as per the array days$FORstartday = 1TO7 DayYearStarted$(startday) = days$(startday) DayYearStarted$(startday + 7) = days$(startday)NEXTstartday'1901 started on yeartype 3 and the repeating sequence for yeartypes is :_' 3 45 13 1 2 3 11 6 7 1 9 4 5 6 14 2 3 4 12 7 1 2 10 5 6 7 8DIMyearsequence(28) yearsequence(1) = 3' if year = 1901 then use yearsequence(1)yearsequence(2) = 4' if year = 1902 then use yearsequence(2)yearsequence(3) = 5' if year = 1903 then use yearsequence(3)yearsequence(4) = 13 yearsequence(5) = 1: yearsequence(6) = 2: yearsequence(7) = 3 yearsequence(8) = 11: yearsequence(9) = 6: yearsequence(10) = 7 yearsequence(11) = 1: yearsequence(12) = 9: yearsequence(13) = 4 yearsequence(14) = 5: yearsequence(15) = 6: yearsequence(16) = 14 yearsequence(17) = 2: yearsequence(18) = 3: yearsequence(19) = 4 yearsequence(20) = 12: yearsequence(21) = 7: yearsequence(22) = 1 yearsequence(23) = 2: yearsequence(24) = 10: yearsequence(25) = 5 yearsequence(26) = 6: yearsequence(27) = 7: yearsequence(28) = 8 year = VAL(RIGHT$(usedate$, 4))' determine yeartypeIFyearMOD4 = 0THENleap = -1 year = year - 1900:WHILEyear > 28: year = year - 28: WEND: whichyeartype_ = yearMOD29 PointerToDayYearStarted = yearsequence(whichyeartype) startdayvalue = PointerToDayYearStartedIFstartdayvalue > 7THENstartdayvalue = startdayvalue - 7: startday$ =_ DayYearStarted$(PointerToDayYearStarted)' compute number of days this yearnumofcompletemonths = VAL(MID$(usedate$, 1, 2)) - 1FORcountmonths = 1TOnumofcompletemonths numofdays = numofdays + VAL(month$(countmonths, 2)):NEXTcountmonths numofdays = numofdays + VAL(MID$(usedate$, 4, 2))IFleapTHENIFVAL(MID$(usedate$, 1, 2)) > 1THENIFVAL(MID$(usedate$, 1, 2)) > 2ORVAL(MID$(usedate$, 4, 2)) > 28THENnumofdays = numofdays + 1ENDIFENDIFENDIFwhatday = (numofdaysMOD7) - 1 whatday = whatday + startdayvalueIFwhatday > 7THENwhatday = whatday - 7 thisday$ = days$(whatday) thismonth$ = month$(VAL(MID$(usedate$, 1, 2)), 1) calendardate$ = MID$(usedate$, 4, 2) thisyear$ = RIGHT$(usedate$, 4) SP$ = SPACE$(22)IFleapANDnumofdays > (31 + 28)THENCOLOR7, 0:COLOR15, 0IFleapTHENPRINT "LEAP ";IFx$ = "u"ORx$ = "U"THENELSEENDIFCOLOR14, 0COLOR15, 0DO: x$ =INKEY$:IFx$ = "Y"ORx$ = "y" OR x$ = "N" OR x$ = "n"THENEXITDOLOOPIFx$ = "Y"ORx$ = "y"THENCLEAR:GOTObeginLOCATE24, 27:COLOR25, 0:END________O_/________________________| SNIP |______________________\_O_______ O \ | HERE | / O Line wrapping and message splitted accomplished by MsgSplit 2.00, a Victor Yiu and Scott Wunsch creation. Michel --- GoldED * Origin: Blainville, Quebec (1:242/130)

Echo Basic Postings

**Books at Amazon:**

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET