home *** CD-ROM | disk | FTP | other *** search
-
- type hstring=string[4];
-
- function zwei(str:hstring):hstring;
- begin
- zwei:=copy('0'+str,length(str),2);
- end;
-
- type
- TimeString = string[8];
-
- function time: TimeString;
- (* Für Turbo 3.0 Kommentarklammern entfernen
- type Registers = record
- case integer of
- 1 : (ax,bx,cx,dx,bp,si,di,ds,es,flags: word);
- 2 : (al,ah,bl,bh,cl,ch,dl,dh : BYTE);
- end;
- *)
-
- var
- recpack: Registers; {assign record}
- ah,al,ch,cl,dh: byte;
- hour,min,sec: string[2];
-
- begin
- recpack.ah := $2c; {initialize correct registers}
- intr($21,recpack); {call interrupt}
- with recpack do
- begin
- str(ch,hour);
- hour:=zwei(hour); {convert to string}
- str(cl,min);
- min:=zwei(min); { " }
- str(dh,sec);
- sec:=zwei(sec); { " }
- end;
- time := hour+':'+min+':'+sec;
- end;
-
- type
- DateStr = string[10];
-
- function Date: DateStr;
-
- var
- recpack: Registers; {record for MsDos call}
- month,day: string[2];
- year: string[4];
- dx,cx: integer;
-
- begin
- with recpack do
- begin
- ax := $2a shl 8;
- end;
- MsDos(recpack); { call function }
- with recpack do
- begin
- str(cx,year); {convert to string}
- str(dx mod 256,day);
- day:=zwei(day); { " }
- str(dx shr 8,month);
- month:=zwei(month); { " }
- end;
- date := day+'.'+month+'.'+year;
- end;
-
-