Top.Mail.Ru
Мастера DELPHI, Delphi programming community Титульная страница Поиск, карта сайта Написать письмо 
| Новости | Поиск | FAQ | Статьи | Книги | Новости VCL |
| Форумы ЧАТ | Орешник | KOL и MCK |
Форумы -» Основная («Начинающим»)/ Базы / WinAPI / Компоненты / Сети / Media / Игры / Corba и COM / KOL / FreePascal / .Net / Прочее / RSDN.ORG

« предыдущая ветвь | форум | следующая ветвь »

Как создать класс Таблица?


gedevan ©   (2016-02-25 18:36:00) 

Хочу создать класс, соответствующий таблице. В таблице есть колонки. Эти колонки можно добавлять и удалять, т.е. предварительно это вроде как массив с именами колонок.

А как хранить строки? при том, что колонок разное количество? Создавать двухмерный массив? 1 измерение это колонка, 2е строка.

Но что если в разных колонках разные типы данных?

и еще я бы хотел чтобы в строке к имени колонки можно было обращаться через точку.

Т.е. Tab:TMytab;

Tab.strings[0].FirstCol := 3;

можно ли как то такое организовать?


Kilkennycat   (2016-02-26 12:12:00) [1]

XML


Германн   (2016-02-26 02:18:00) [2]

TStringGrid ?


Игорь Шевченко   (2016-02-25 21:05:00) [3]

Excel


Юрий Зотов   (2016-02-25 20:26:00) [4]

TMemoryDataSet + TDBGrid ?


Sha   (2016-02-25 19:29:00) [5]

Creating array properties
Some properties lend themselves to being indexed like arrays. For example, the Lines property of TMemo is an indexed list of the strings that make up the text of the memo; you can treat it as an array of strings. Lines provides natural access to a particular element (a string) in a larger set of data (the memo text).

Array properties are declared like other properties, except that

The declaration includes one or more indexes with specified types. The indexes can be of any type.
The read and write parts of the property declaration, if specified, must be methods. They cannot be fields.

The read and write methods for an array property take additional parameters that correspond to the indexes. The parameters must be in the same order and of the same type as the indexes specified in the declaration.

There are a few important differences between array properties and arrays. Unlike the index of an array, the index of an array property does not have to be an integer type. You can index a property on a string, for example. In addition, you can reference only individual elements of an array property, not the entire range of the property.


Наверх

Титульная страница Поиск, карта сайта Написать письмо