home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / qb_pds / qb_sub / whatday.sub < prev   
Encoding:
Text File  |  1987-07-14  |  3.2 KB  |  90 lines

  1. '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. '%  (C) 1987 HUMBLEWARE Custom Programming    Author: Lawrence A. Westhaver  %
  3. '%        247 Paul Martin Drive,  Baltimore MD  21227  (301) 799-1975        %
  4. '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  5. '%                                                                           %
  6. '%     FILENAME: WHATDAY.SUB                     LAST UPDATE: 06-29-1987     %
  7. '%                                                                           %
  8. '%  DESCRIPTION: Determines the day of the week (Sun-Sat) from DOS.          %
  9. '%                                                                           %
  10. '%         CALL: CALL WHATDAY(DAY%,DAY$)                                     %
  11. '%                                                                           %
  12. '%       INPUTS: None.                                                       %
  13. '%                                                                           %
  14. '%      OUTPUTS: DAY% = An integer value representing the day of the week.   %
  15. '%                                                                           %
  16. '%               DAY$ = A string value representing the day of the week.     %
  17. '%                                                                           %
  18. '%                 On  Sunday     DAY% = 0  and  DAY$ = "Sunday"             %
  19. '%                     Monday     DAY% = 1  and  DAY$ = "Monday"             %
  20. '%                     Tuesday    DAY% = 2  and  DAY$ = "Tuesday"            %
  21. '%                     Wednesday  DAY% = 3  and  DAY$ = "Wednesday"          %
  22. '%                     Thursday   DAY% = 4  and  DAY$ = "Thursday"           %
  23. '%                     Friday     DAY% = 5  and  DAY$ = "Friday"             %
  24. '%                     Saturday   DAY% = 6  and  DAY$ = "Saturday"           %
  25. '%                                                                           %
  26. '%         NOTE: The Microsoft QuickBASIC INT86 assembly routine must be     %
  27. '%               linked into your program at compile time or it must be      %
  28. '%               present in the QuickBASIC USERLIB.EXE file before this      %
  29. '%               routine can be used.                                        %
  30. '%                                                                           %
  31. '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  32.  
  33.  
  34. SUB WHATDAY(DAY%,DAY$) Static
  35.  
  36.  
  37. 'dim parameter storage for INT86 call
  38.  
  39.     DIM PARMIN%(7),PARMOUT%(7)
  40.  
  41.  
  42. 'declare indexes for INT86 calls
  43.  
  44.     AXREG%=0    'AX register
  45.     BXREG%=1    'BX register
  46.     CXREG%=2    'CX register
  47.     DXREG%=3    'DX register
  48.     BPREG%=4    'BP register
  49.     SIREG%=5    'SI register
  50.     DIREG%=6    'DI register
  51.     FLAGS%=7    'Flags
  52.  
  53.  
  54. 'declare day string storage
  55.  
  56.     DIM DAY$(6)
  57.  
  58.  
  59. 'fill day array
  60.  
  61.     DAY$(0)="Sunday"
  62.     DAY$(1)="Monday"
  63.     DAY$(2)="Tuesday"
  64.     DAY$(3)="Wednesday"
  65.     DAY$(4)="Thursday"
  66.     DAY$(5)="Friday"
  67.     DAY$(6)="Saturday"
  68.  
  69.  
  70. 'clear output variables
  71.  
  72.     DAY%=0
  73.     DAY$=""
  74.  
  75.  
  76. 'invoke get date function
  77.  
  78.     PARMIN%(AXREG%)=&H2A00
  79.     CALL INT86(&H21,VARPTR(PARMIN%(0)),VARPTR(PARMOUT%(0)))
  80.  
  81.  
  82. 'set output variables
  83.  
  84.     DAY%=PEEK(VARPTR(PARMOUT%(AXREG%)))
  85.     DAY$=DAY$(DAY%)
  86.  
  87.  
  88. END SUB 'whatday
  89.  
  90.