The digital clock in pascal

Delphi & Pascal (česká wiki)
Přejít na: navigace, hledání
Category: KMP (Club of young programmers)

Author: Róbert Bobák
Program: Hodiny.pas
File exe: Hodiny.exe

The digital clock. A funny conclusion when quitting it.
{ HODINY.PAS                                                        }
{                                                                   }
{ Author: Robert Bobak                                              }
{ Date  : 15.02.1997                           http://www.trsek.com }
 
program hodiny;
uses crt,dos;
var h,m,h1,m1,s,s1,stot,stot1:word;
procedure KurzorZap(ZapVyp:boolean);
  var
    Regs : Registers;
  begin
     with Regs do
     begin
        AH := $03;
        BH := $00;
        Intr($10,Regs);
        If not (Zapvyp) then
        CH := CH or $20
        else
        CH := CH and $DF;
        AH := $01;
        Intr($10,Regs);
     end;
  end;
 
begin
clrscr;
 
repeat
gettime(h,m,s,stot);
if (h<>h1) or (m<>m1) or (s<>s1) or (stot<>stot1) then begin
gotoxy(35,12);writeln('ÉÍÍÍÍÍÍÍÍÍÍÍť');
gotoxy(35,13);writeln('ş           ş');
gotoxy(35,14);writeln('ČÍÍÍÍÍÍÍÍÍÍÍź');
gotoxy(36,13);
if h<10 then write('0');write(h,':');h1:=h;m1:=m;s1:=s;stot1:=stot;
if m<10 then write('0');write(m,':');
if s<10 then write('0');write(s,':');
if stot<10 then write('0');writeln(stot);
end;
kurzorzap(false);
until keypressed;
if (h>18) and (m>39) then write('Palo chod domov!!!');
delay(5000);
end.