home *** CD-ROM | disk | FTP | other *** search
- '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- '% (C) 1987 HUMBLEWARE Custom Programming Author: Lawrence A. Westhaver %
- '% 247 Paul Martin Drive, Baltimore MD 21227 (301) 799-1975 %
- '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- '% %
- '% FILENAME: WHATDAY.SUB LAST UPDATE: 06-29-1987 %
- '% %
- '% DESCRIPTION: Determines the day of the week (Sun-Sat) from DOS. %
- '% %
- '% CALL: CALL WHATDAY(DAY%,DAY$) %
- '% %
- '% INPUTS: None. %
- '% %
- '% OUTPUTS: DAY% = An integer value representing the day of the week. %
- '% %
- '% DAY$ = A string value representing the day of the week. %
- '% %
- '% On Sunday DAY% = 0 and DAY$ = "Sunday" %
- '% Monday DAY% = 1 and DAY$ = "Monday" %
- '% Tuesday DAY% = 2 and DAY$ = "Tuesday" %
- '% Wednesday DAY% = 3 and DAY$ = "Wednesday" %
- '% Thursday DAY% = 4 and DAY$ = "Thursday" %
- '% Friday DAY% = 5 and DAY$ = "Friday" %
- '% Saturday DAY% = 6 and DAY$ = "Saturday" %
- '% %
- '% NOTE: The Microsoft QuickBASIC INT86 assembly routine must be %
- '% linked into your program at compile time or it must be %
- '% present in the QuickBASIC USERLIB.EXE file before this %
- '% routine can be used. %
- '% %
- '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
- SUB WHATDAY(DAY%,DAY$) Static
-
-
- 'dim parameter storage for INT86 call
-
- DIM PARMIN%(7),PARMOUT%(7)
-
-
- 'declare indexes for INT86 calls
-
- AXREG%=0 'AX register
- BXREG%=1 'BX register
- CXREG%=2 'CX register
- DXREG%=3 'DX register
- BPREG%=4 'BP register
- SIREG%=5 'SI register
- DIREG%=6 'DI register
- FLAGS%=7 'Flags
-
-
- 'declare day string storage
-
- DIM DAY$(6)
-
-
- 'fill day array
-
- DAY$(0)="Sunday"
- DAY$(1)="Monday"
- DAY$(2)="Tuesday"
- DAY$(3)="Wednesday"
- DAY$(4)="Thursday"
- DAY$(5)="Friday"
- DAY$(6)="Saturday"
-
-
- 'clear output variables
-
- DAY%=0
- DAY$=""
-
-
- 'invoke get date function
-
- PARMIN%(AXREG%)=&H2A00
- CALL INT86(&H21,VARPTR(PARMIN%(0)),VARPTR(PARMOUT%(0)))
-
-
- 'set output variables
-
- DAY%=PEEK(VARPTR(PARMOUT%(AXREG%)))
- DAY$=DAY$(DAY%)
-
-
- END SUB 'whatday
-
-