unit Unit3;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls,tijdreken;

type
  TForm3 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Button1: TButton;
    Label3: TLabel;
    Label4: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit4: TEdit;
    Edit5: TEdit;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Button2: TButton;
    Button3: TButton;
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    
      duur :smallint;
      dmin : smallint;
  end;

var
  Form3: TForm3;

implementation


{$R *.DFM}


procedure TForm3.Button3Click(Sender: TObject);
var luur,lmin,uur,min,atuur,atmin: smallint;
    str,str2 :string;
    teller : integer;
begin
  str:='0'+Edit1.Text; str2:='';
  for teller:=0 to length (str) do
  begin
    if (str[teller]>='0') and (str[teller]<='9')
      then str2:=str2+str[teller];
  end;
  luur:=StrToInt (str2);
  str:='0'+Edit2.Text; str2:='';
  for teller:=0 to length (str) do
  begin
    if (str[teller]>='0') and (str[teller]<='9')
      then str2:=str2+str[teller];
  end;
  lmin:=StrToInt (str2);
  addtime (luur,lmin,duur,dmin,uur,min);
  attime (uur,min,atuur,atmin);
  Edit4.Text:=IntToStr (atuur);
  Edit5.Text:=IntToStr (atmin);
end;

procedure TForm3.Button2Click(Sender: TObject);

var luur,lmin,uur,min,atuur,atmin: smallint;
    str,str2 :string;
    teller : integer;
begin
  str:='0'+Edit4.Text; str2:='';
  for teller:=0 to length (str) do
  begin
    if (str[teller]>='0') and (str[teller]<='9')
      then str2:=str2+str[teller];
  end;
  atuur:=StrToInt (str2);
  str:='0'+Edit5.Text; str2:='';
  for teller:=0 to length (str) do
  begin
    if (str[teller]>='0') and (str[teller]<='9')
      then str2:=str2+str[teller];
  end;
  atmin:=StrToInt (str2);
  at_gmttime (atuur,atmin,uur,min);
  addtime (uur,min,-duur,-dmin,luur,lmin);
  Edit1.Text:=IntToStr (luur);
  Edit2.Text:=IntToStr (lmin);
end;

end.
