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

Вниз

как создать тип к кот. можно обр. ро индексу и как к простому?   Найти похожие ветки 

 
MSergey ©   (2002-06-12 02:59) [0]

Плизз. Подскажите как создатьь свой тип данных по аналогии с TListItems"ом , т.е. чтоб к нему можно было обращатся и по индексу и просто как к типу???


 
PVR ©   (2002-06-12 03:16) [1]

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;

type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
TPerson=integer;
TPersonArray=class
private
FList:TList;
function GetPerson(index: integer): TPerson;
function Getpersons(Index: integer): TPerson;
procedure PutPerson(index: integer; Person: TPerson);
procedure Setpersons(Index: integer; const Value: TPerson);
public
property persons[Index:integer]:TPerson read Getpersons write Setpersons;default;
constructor create;
destructor destroy;override;
end;
var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var a:TPersonArray;
begin
a[2]:=a[1];
end;

{ TPersonArray }

constructor TPersonArray.create;
begin
FList.Create;
end;

destructor TPersonArray.destroy;
begin
FList.Free;
inherited;
end;

function TPersonArray.GetPerson(index: integer): TPerson;
begin

end;

function TPersonArray.Getpersons(Index: integer): TPerson;
begin

end;

procedure TPersonArray.PutPerson(index: integer; Person: TPerson);
begin

end;

procedure TPersonArray.Setpersons(Index: integer; const Value: TPerson);
begin

end;

end.





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

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

Наверх




Память: 0.47 MB
Время: 0.021 c
3-77307
Pavel_S
2002-05-30 10:43
2002.06.24
Событие BeforeScroll


14-77593
Kiko
2002-05-21 14:56
2002.06.24
Помогите организовать структуру БД


3-77287
Fissher
2002-05-30 18:38
2002.06.24
Прога не работает на другой машине


14-77595
Blackweber
2002-05-21 21:40
2002.06.24
Срочно!!!! arcsin,arccos


3-77312
vopros
2002-05-31 13:27
2002.06.24
Sql запрос. Сорри думать некогда над ним.Помогите