Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: code interpretation in OOP



Permlink Replies: 0
Lex Dean

Posts: 132
Registered: 3/26/07
code interpretation in OOP
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 9, 2018 11:39 AM
I have written Tbar that contains a a TCollection descendant

TabTBar = class(TPannel)

published
property Buttons: TButts read FButs write SetButs;

................
................

procedure TabTBar.SetButs(const Value: TButts);
begin
FButs.Assign(Value);
end;

in my code I write I write

Tbar.Buttons[11].ComBoBox.Items.Add(intToStr(I));

The reference "Tbar.Buttons[11]" the compiler does not like?

When I build this I have to write in the IDE 'Items.Add(intToStr(I));'

but when I make
var aComboDevType: TButt
begin
aComboDevType := Tbar.Buttons[11]'
aComboDevType.ComBoBox.Items.Add(intToStr(I));

The IDE and compiler works fine

what can I do to simply write "Tbar.Buttons[11].ComBoBox.Items.Add(intToStr(I));"

and the compiler accept it

Delphi 7

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02