Вниз
Скачать: 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.006 c
1-1237817783
Дмитрий Белькевич
2009-03-23 17:16
2010.02.14
SHBrowseForFolder открывается пустым


15-1260307828
Юрий
2009-12-09 00:30
2010.02.14
С днем рождения ! 9 декабря 2009 среда


2-1260715573
Нагуглить_не_смог
2009-12-13 17:46
2010.02.14
UTF-8 -> ANSI


2-1260723444
Дмитрий
2009-12-13 19:57
2010.02.14
Отображение информации из базы данных


15-1260119974
TUser
2009-12-06 20:19
2010.02.14
Непятничная задача




   Наверх