Top.Mail.Ru Yandeks.Metrika
Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];


ListBox Find similar branches

Ser_Kham1   (2001-12-17 16:10) [0]

Good afternoon, gentlemen.
I read help on the ListBox and read in the description of the Items property:
"By default, the items in a list box are of type TStrings."
And what can somehow be changed is By default and done so that items in
a list box are of any other type?
Regards, baby.

MBo   (2001-12-17 16:18) [1]

a) no, unless you rewrite it yourself
b) there is no need, because to every line in strings you can attach an object - any!

Fellomena   (2001-12-17 17:08) [2]

Mbo said it right, here is an example:

i: real;
i: = 1.35;
i: = sqrt (i * i);
ListBox1.Items [0]: = FloatToStr (i); // type conversion mechanism


MBo   (2001-12-17 17:12) [3]

I meant listbox1.items.objects [i]

Fellomena   (2001-12-17 17:14) [4]

... who cares ?

Ser_Kham1   (2001-12-17 17:19) [5]

Thanks MBo. It will suit me. However, the question arises, when I insert or add new elements to the list, I will need to dynamically create the corresponding Objects. However, then I will probably need to take care of deleting dynamically created Objects, or will the compiler do the dirty work for me?

Виктор Щербаков   (2001-12-17 17:23) [6]

You will have to delete it yourself.
To destroy objects automatically you need to use

Dimka Maslov   (2001-12-17 17:24) [7]

The compiler will not do the dirty work. You need to take care of creating objects and freeing them yourself.

MBo   (2001-12-17 17:25) [8]

the difference in the ability to add ANY object - from the icon to the featured component, if, of course, such a desire arises

Yes, you must delete it manually. From the standard Delphi data structures, as far as I remember, only TObjectList itself releases its elements.

Fellomena   (2001-12-17 17:31) [9]

2 Mbo: yes no ... the difference between the object and, for example, the string value, I understand =)
I meant that the implementation (software) of the ListBox does not change (if you know what I mean).

MBo   (2001-12-17 17:37) [10]

I got it.

Pages: 1 whole branch

Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];


Memory: 0.58 MB
Time: 0.031 c
1 - 22050
2001-12-18 17:03

4 - 22477
2001-10-31 12:17
How to see all the processes running all the programs?

4 - 22509
2001-11-08 12:50
GetkeyboardState- What does?

3 - 21993
2001-12-07 09:23
Search in database (Very urgent !!!)

3 - 21909
2001-12-03 15:21
Good day, I need advice, plz

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
English French German Italian Portuguese Russian Spanish