Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Начинающим";
Текущий архив: 2008.12.14;
Скачать: [xml.tar.bz2];

Вниз

Списки   Найти похожие ветки 

 
Nameziz   (2008-11-05 12:05) [0]

Хочу написать свой класс-список, TIntList (большинство методов будут как и в TStringList, только для работы с целыми числами). Вопрос от какого класса наследоваться?


 
Сергей М. ©   (2008-11-05 12:08) [1]

Например, от TList


 
Palladin ©   (2008-11-05 12:22) [2]

Type
TIntList=Class
 Private
  m_theList:TList;

  Function lcGetCount:Integer;
  Function lcGetItem(p_nIndex:Integer):Integer;
  Procedure lcSetItem(p_nIndex,p_nValue:Integer);
 Public
  Constructor Create;
  Destructor Destroy; Override;

  Property Count:Integer Read lcGetCount;
  Property Items[nIndex:Integer]:Integer Read lcGetItem Write lcSetItem; Default;
  Procedure Add(p_nData:Integer);
  Procedure Delete(p_nIndex:Integer);
  Procedure Clear;
End;

Constructor TIntList.Create;
Begin
 m_theList:=TList.Create;
End;

Destructor TIntList.Destroy;
Begin
 m_theList.Free;
End;

Function TIntList.lcGetCount;
Begin
 Result:=m_theList.Count;
End;

Procedure TIntList.Add;
Begin
 m_theList.Add(Pointer(p_nData));
End;

Procedure TIntList.lcSetItem;
Begin
 m_theList[p_nIndex]:=Pointer(p_nValue);
End;

Procedure TIntList.Delete;
Begin
 m_theList.Delete(p_nIndex);
End;

Function TIntList.lcGetItem;
Begin
 Result:=Integer(m_theList[p_nIndex]);
End;

Procedure TIntList.Clear;
Begin
 m_theList.Clear;
End;


 
Anatoly Podgoretsky ©   (2008-11-05 12:27) [3]


> Например, от TList

Не например, а именно от него, если конечно недостаточно возможностей TList


 
Nameziz   (2008-11-05 12:44) [4]

Спасибо всем



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

Форум: "Начинающим";
Текущий архив: 2008.12.14;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.01 c
15-1223346112
axd
2008-10-07 06:21
2008.12.14
jQuery portlets


2-1225286926
Savek
2008-10-29 16:28
2008.12.14
Программа не завершается


15-1223864185
Slider007
2008-10-13 06:16
2008.12.14
С днем рождения ! 12 октября 2008 воскресенье


1-1204138664
POP
2008-02-27 21:57
2008.12.14
SHA-1


2-1225405338
aKor
2008-10-31 01:22
2008.12.14
вопрос по БД





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский