![]() |
|
|
|||||||
| Регистрация | << Правила форума >> | FAQ | Пользователи | Календарь | Поиск | Сообщения за сегодня | Все разделы прочитаны |
![]() |
|
|
Опции темы | Поиск в этой теме | Опции просмотра |
|
|
|
#1
|
|||
|
|||
|
Пытаюсь в TList вставить следующий класс и получаю access violetion.
слетает на SetAll туда передаю String Где я накололся? Код:
unit Unit2;
interface
type
TSentens = Class
private
stAll : String;
published
procedure SetAll(const Value: String);
function GetAll() : String;
end;
implementation
procedure TSentens.SetAll(const Value: String);
begin
self.stAll := Value;
end;
function TSentens.GetAll;
begin
Result := self.stAll;
end;
end.Последний раз редактировалось jusalex, 21.05.2009 в 17:49. |
|
#2
|
|||
|
|||
|
сам допетрил:
Код:
unit Unit2;
interface
type
TSentens = Class
private
stAll : String;
published
procedure SetAll(const Value: String);
function GetAll() : String;
constructor Create(Text : String);
end;
implementation
constructor TSentens.Create(Text: String);
begin
stAll := Text;
end;
procedure TSentens.SetAll(const Value: String);
begin
self.stAll := Value;
end;
function TSentens.GetAll;
begin
Result := self.stAll;
end;
end.и еще плюс вызывал не правильно и передавал в TList не вызвав Create |
|
#3
|
||||
|
||||
|
А так не проще будет?
Код:
type
TSentens = Class
private
fstAll : String;
published
property stAll: String read fstAll write fstAll;
constructor Create(Text : String);
end; |