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

Down

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:

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

=)



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
TObjectList.



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];

Top





Memory: 0.57 MB
Time: 0.024 c
14-22415
Wetnose
2001-11-12 06:42
2002.01.08
Topics for WinXP


6-22279
Denis
2001-07-28 22:08
2002.01.08
NMSMTP through proxy


14-22416
Nemesis
2001-11-14 11:47
2002.01.08
Need a program of this type


14-22406
VEG
2001-11-10 12:56
2002.01.08
It happened here with me different ...


4-22475
Di_wind
2001-11-02 16:08
2002.01.08
Search





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