Часы в Делфи
Добавлено: 20 фев 2011, 17:19
Пишу данный код в турбо делфи 2006, а он при запуске выдает "Error in module Unit2: Declaration of class TForm2 is missing or incorrect"
Что делать???
[syntax="delphi"]
unit Unit2;
interface
uses SysUtils, Classes;
function gethours: integer;
function getmins: integer;
function getsecs: integer;
implementation
function gethours: integer;
var
s: string;
h: integer;
begin
s := timetostr(time);
h := strtoint(s[1] + s[2]);
Result := h;
end;
function getmins: integer;
var
s: string;
h: integer;
begin
s := timetostr(time);
h := strtoint(s[4] + s[5]);
Result := h;
end;
function getsecs: integer;
var
s: string;
h: integer;
begin
s := timetostr(time);
h := strtoint(s[7] + s[8]);
Result := h;
end;
end.
[/syntax]
Заранее огромное спасибо
Что делать???
[syntax="delphi"]
unit Unit2;
interface
uses SysUtils, Classes;
function gethours: integer;
function getmins: integer;
function getsecs: integer;
implementation
function gethours: integer;
var
s: string;
h: integer;
begin
s := timetostr(time);
h := strtoint(s[1] + s[2]);
Result := h;
end;
function getmins: integer;
var
s: string;
h: integer;
begin
s := timetostr(time);
h := strtoint(s[4] + s[5]);
Result := h;
end;
function getsecs: integer;
var
s: string;
h: integer;
begin
s := timetostr(time);
h := strtoint(s[7] + s[8]);
Result := h;
end;
end.
[/syntax]
Заранее огромное спасибо