![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Помогите создать класс
oleg1963lora © (2009-12-17 15:22:00)Здравствуйте уважаемые Мастера! Помогите пожалуйста исправить объявление класса. Компилируется, но вызывает исключение. Что я не сделал? Текст:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
public
end;
TStatistics = class(TObject)
private
FList : TStringList;
public
Constructor Create;
Destructor Destroy;override;
end;
var
Form1: TForm1;
Statistic : TStatistics;
implementation
{$R *.dfm}
{ TStatistics }
constructor TStatistics.Create;
begin
inherited;
FList:=TStringList.Create;
end;
destructor TStatistics.Destroy;
begin
FList.Free;
inherited;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Statistic:=Statistic.Create; {здесь вызывает исключение}
Statistic.Destroy;
end;
end.
Германн (2009-12-17 15:32:00) [1]
> Тема закрыта.
После сессии закроем. :)
oleg1963lora (2009-12-17 15:30:00) [2]Спасибо огромное! Все работает!
Тема закрыта.
Сергей М. (2009-12-17 15:24:00) [3]Точнее
> Statistic:= TStatistic s.Create
Сергей М. (2009-12-17 15:23:00) [4]
> Statistic:= TStatistic.Create