Показать сообщение отдельно
  #4  
Старый 11.04.2008, 14:30
MegaPiha MegaPiha вне форума
Активный
 
Регистрация: 24.03.2008
Сообщения: 227
Версия Delphi: Delphi 7
Репутация: 30
По умолчанию

Код:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Mask, DateUtils;

type
  TForm1 = class(TForm)
    Button1: TButton;
    MaskEdit1: TMaskEdit;
    MaskEdit2: TMaskEdit;
    MaskEdit3: TMaskEdit;
    Memo1: TMemo;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var a,b,c:string;
    at,bt,ct:TDateTime;
     i,j,k, k1:integer;
begin

   Memo1.Lines.Clear;
    a:=FormatDateTime('hh:mm',StrToTime(MaskEdit1.Text));
    b:=FormatDateTime('hh:mm',StrToTime(MaskEdit2.Text));
    c:=FormatDateTime('hh:mm',StrToTime(MaskEdit3.Text));
    i:=MinutesBetween(StrToTime(a),StrToTime(b));
    j:=MinutesBetween(0,StrToTime(c));
    k:=i div j;
    at:=StrToTime(a);
    bt:=StrToTime(b);
    ct:=StrToTime(c);
    For i:=0 to k do
    begin
       a:=FormatDateTime('hh:mm',at);
       c:=FormatDateTime('hh:mm',at+ct);
       Memo1.Lines.Add(a +' '+c);
       at:=at+ct;
    end;
end;

end.

Может я конечно чего и наворотил, извиняюсь. Но работает вроде как надо.
Ответить с цитированием