home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a075 / 1.img / TOOLKIT1.EXE / SST180.PRG < prev    next >
Encoding:
Text File  |  1989-08-08  |  738 b   |  39 lines

  1. ********************
  2.  
  3. FUNCTION Workdays
  4.  
  5.    PARAMETERS _date1, _date2, _exceptions
  6.  
  7.    PRIVATE _warray, _totdays, _totsats, _busdays, _qaz
  8.  
  9.    IF PCOUNT() < 2
  10.       RETURN(0)
  11.    ENDIF
  12.  
  13.    IF _date2 < _date1   && End date less than beginning date
  14.       RETURN(0)
  15.    ENDIF
  16.  
  17.    _warray = ( PCOUNT() = 3 )
  18.  
  19.    _totdays = _date2 - _date1
  20.    _totsats = (INT(_totdays / 7 ) + IF( ( DOW(_date2) < DOW(_date1) ), 1, 0 )) * 2
  21.    _busdays = _totdays - _totsats
  22.    IF _warray
  23.       FOR _qaz = 1 TO LEN(_exceptions)
  24.          IF _exceptions[_qaz] >= _date1 .AND. _exceptions[_qaz] <= _date2
  25.             _busdays = _busdays - 1
  26.          ENDIF
  27.       NEXT
  28.    ENDIF
  29.    RETURN(_busdays)
  30.          
  31. * End of File
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.