BBS: Inland Empire Archive
Date: 04-16-92 (16:48) Number: 112
From: DICK DENNISON Refer#: NONE
To: GARY POOL Recvd: NO
Subj: Re: Date Routine Question Conf: (2) Quik_Bas
GP> Does anyone have a good routine that will tûßÛûñ…ïkeñ…ûllû the day of
GP> the week from the date? (Sorry, a lot of line noise today).
GP> For example, Call DayOfWeek$(Date$) would call a Function DayOfWeek$
GP> that would return Monday, Tuesday, Wednesday, etc. A friend of mine d
GP> it in assembler on the host, but if I ask him for the algorithm, he wi
GP> harrass me to no end. I'm sure that this is something that has been
GP> done many times before, so I'd rather not reinvent the wheel. Thanks
GP> advance. gp
DIM InRegs AS RegType, OutRegs AS RegType
DIM Day(7) AS STRING * 3
Day$(0) = "Sun": Day$(1) = "Mon": Day$(2) = "Tue": Day$(3) = "Wed"
Day$(4) = "Thu": Day$(5) = "Fri": Day$(6) = "Sat"
InRegs.ax = &H2A * 256
CALL INTERRUPT(&H21, InRegs, OutRegs)
PRINT OutRegs.cx; " = year"
PRINT OutRegs.dx \ 256; " = month"
PRINT OutRegs.dx MOD 256; " = date"
daynum% = OutRegs.ax MOD 256
PRINT "Day of the week is "; Day$(daynum%)
--- VP [DOS] V4.09e
* Origin: New York Quick Share Point * HST (914)374-3903 (1:272/34)