home *** CD-ROM | disk | FTP | other *** search
- { ╔═══╦══════════════════════════════════════════════╦═══╗
- ║ ║ Pascal Library by Scott Wade ║ ║
- ║ ║ 715 FM 1959 Apt 310 ║ ║
- ║ ║ Houston, TX 77034 ║ ║
- ┌──────╨───╨──────────────────────────────────────────────╨───╨──────┐
- │ This group of routines is contributed to public domain, and no │
- │ one can possibly get any commercial value out of them since they │
- │ must be used in other programs. I require that if these are used │
- │ as is in any program, that this banner remain with the source │
- │ code of the program. I would appreciate any comments or sugges- │
- │ tions on improvements, & am curious to hear how these are used. │
- │ You can leave a message for me on these BBS's: │
- │ Ziggy's 821-1391 ScoreBoard 583-7848 │
- │ TBL-COMM 661-9040 Test-Mode 660-9252 │
- └────────────────────────────────────────────────────────────────────┘
-
- wTime.LIB v1.2 current Time and Date library.
- v1.1: 9 /27/85 : The '19' is chopped from year to allow the date to fit into
- global type word : string[ 10 ]
- v1.2: 10/17/85 : procedure wMONTH added to allow other routines to convert
- integers 1-12 to months. wTime calls wMonth. }
-
- procedure wMonth( mnth : integer ; var Date : word );
- begin
- case Mnth of
- 1 : Date := 'JAN' ; 2 : Date := 'FEB' ;
- 3 : Date := 'MAR' ; 4 : Date := 'APR' ;
- 5 : Date := 'MAY' ; 6 : Date := 'JUN' ;
- 7 : Date := 'JUL' ; 8 : Date := 'AUG' ;
- 9 : Date := 'SEP' ; 10 : Date := 'OCT' ;
- 11 : Date := 'NOV' ; 12 : Date := 'DEC'
- else Date := 'ERR'
- end { end CASE }
- end{ wMonth };
-
- procedure wTime(var Time, Date : Word);
- type
- regpack = record ax,bx,cx,dx,bp,di,si,ds,es,flags: integer; end;
- var
- recpack : regpack ; {assign record}
- day,year : string[ 4];
- hour,min,sec : string[ 2];
- ah,al : byte ;
- begin
- ah := $2c; {initialize correct registers}
- with recpack do ax := ah shl 8 + al ;
- intr($21,recpack); {call interrupt}
-
- with recpack do begin
- str(cx shr 8,hour); {convert to string}
- str(cx mod 256,min); { " }
- str(dx shr 8,sec);
- end{ WITH RecPack DO };
-
- time := hour + ':' + min + ':' + sec ;
-
- with recpack do ax := $2a shl 8;
- MsDos(recpack); { call function }
- with recpack do begin
- str(cx,year) ; {convert to string}
- str(dx mod 256,day) ; { " }
- end;{ WITH RecPack DO }
- wMonth( (recpack.dx shr 8), Date);
- year := copy( year, 3, 4);
- date := Date + '/' + day + '/' + year ;
- end;{ wTime.LIB
- *****************************************************************************}