Главная страница
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.01 c
2-1260911668
Лёша
2009-12-16 00:14
2010.02.14
Диалог выбора директории.


1-1237819822
Marfusha
2009-03-23 17:50
2010.02.14
Запуск макроса OpenOffice из Delphi


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


15-1260140497
KilkennyCat
2009-12-07 02:01
2010.02.14
ночная поэзия


15-1260119366
Cerberus
2009-12-06 20:09
2010.02.14
Какую СУБД выбрать?