Вниз
Скачать: 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 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.008 c
2-1260916242
Aleks
2009-12-16 01:30
2010.02.14
В обработчик события передаются параметры Node: TTreeNode — узел,


10-1162891871
312kbps
2006-11-07 12:31
2010.02.14
Помощь в организации Client Server DCOM


2-1260795180
ShowMessage
2009-12-14 15:53
2010.02.14
Координаты ShowMessage на форме


2-1260955745
Wander
2009-12-16 12:29
2010.02.14
Консольная программа в Делфи


15-1260309385
GanibalLector
2009-12-09 00:56
2010.02.14
PortMon




   Наверх