Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2010.02.14;
Скачать: CL | DM;

Вниз

Помогите создать класс   Найти похожие ветки 

 
oleg1963lora   (2009-12-17 15:22) [0]

Здравствуйте уважаемые Мастера! Помогите пожалуйста исправить объявление класса. Компилируется, но вызывает исключение. Что я не сделал? Текст:
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:23) [1]


> Statistic:=TStatistic.Create


 
Сергей М. ©   (2009-12-17 15:24) [2]

Точнее

> Statistic:=TStatistics.Create


 
oleg1963lora   (2009-12-17 15:30) [3]

Спасибо огромное! Все работает!

Тема закрыта.


 
Германн ©   (2009-12-17 15:32) [4]


> Тема закрыта.

После сессии закроем. :)



Страницы: 1 вся ветка

Текущий архив: 2010.02.14;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.021 c
15-1260221418
Юрий
2009-12-08 00:30
2010.02.14
С днем рождения ! 8 декабря 2009 вторник


2-1260872714
Андрей_11
2009-12-15 13:25
2010.02.14
Combobox


2-1260824299
andrewtitoff
2009-12-14 23:58
2010.02.14
MySQL


15-1260141298
Kerk
2009-12-07 02:14
2010.02.14
Грамотность


4-1228932250
alextim
2008-12-10 21:04
2010.02.14
Ошибки страницы