TIP: Click on subject to list as thread! ANSI
echo: quik_bas
to: ROGER SCUDDER
from: PAT PRIDGEN
date: 1997-12-18 06:35:00
subject: date getting

[In a message from Roger Scudder to Pat Pridgen ]
 PP> SELECT CASE Mth%
 PP>     CASE 1
 PP>     Month$ = "Jan"
 RS> 'You can make this code a lot more elegant by creating a table...
Good point Roger. I really hadn't gotten that far with that little piece
of code, but...I will incorporate this idea into it.
That having been said, here's a little more compact version.
' ***************************************************************
' DOS Service interrupt 21 Function 2Ah
' get information regarding system date.
'
'INT 21 - DOS 1+ - GET SYSTEM DATE
'        AH = 2Ah
'RETURN: CX = year(1980 - 2099)
'      DX \ 256 = Dh = month  
'   DX AND &HFF = DL = day   (Todays Date)
'   AX AND &HFF = AL = day of week (00h=Sunday)
'****************************************************************
'$INCLUDE: 'qbx.bi'    'USE QB.BI for QB45
DIM regs AS RegType
 regs.ax = &H2A00
CALL Interrupt(&H21, regs, regs)
 year% = regs.cx
 Mth% = regs.dx \ 256
 dayno% = regs.dx AND &HFF
 wkday% = regs.ax AND &HFF
'  From: Roger Scudder    Date: 12-15-97  03:55 
'**** The following code was suggested by Roger Scudder, in lieu of the
'**** lengthy SELECT CASE I initially used.
MONTHTAB$ = "JanFebMarAprMayJunJulAugSepOctNovDec"
MONTH$ = MID$(MONTHTAB$, Mth% * 3 - 2, 3)
'So...something similar for the Day of the Week.
DOW$ = "SunMonTueWedThuFriSat"
today$ = MID$(DOW$, wkday% * 3 + 1, 3)
CLS
PRINT "Year - "; year%
PRINT "Month - "; MONTH$
PRINT "Todays date - "; dayno%
PRINT "Today is a - "; today$
                       Pat, pat.pridgen@svis.org
                           La Grande, Oregon
*SignIt 2.x #001* 
--- Maximus 2.02
---------------
* Origin: THE LOFT in Auburn IN 219-925-5524 & 238-3222 HST/V34+ (1:236/7)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.