Re: Date$ ???

 BBS: Inland Empire Archive
Date: 12-13-92 (06:41)             Number: 325
From: DICK DENNISON                Refer#: NONE
  To: BOB OEHRLE                    Recvd: NO  
Subj: Re: Date$   ???                Conf: (2) Quik_Bas
BO> While in Dos if I call for the date I get Wed-12-12-92. If I print
BO> date$ in qb4.5 I get 12-12-92.  Is there away that I can get the days
BO> to print ?? It seems that if I use Mid$ function I can't extract Wed .
BO> I'm trying to write a calendar routine that will alert me at start up
BO> every wednesday to preform a particular job.
BO> Bob in NJ

'Try this:

'Day of Week - Dick Dennison 10/26/89
'$INCLUDE: ''    'load qb with the /L switch
'Interrupt 21 Function 2AH - get date
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"
CLS = &H2A * 256   '2Ah in ah
CALL INTERRUPT(&H21, InRegs, OutRegs)
' * * * cx is the year, dh is the month, dl is the date, al is the day
PRINT; " = year"
PRINT OutRegs.dx \ 256; " = month"
PRINT OutRegs.dx MOD 256; " = date"
daynum% = MOD 256
PRINT "Day of the week is "; Day$(daynum%)

--- VP [DOS] V4.09e
 * Origin: The MailMan  (914)374-3903 NY Quick Share Pt #7 *HST (1:272/34)
Outer Court
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