xylian
14 years agoOccasional Contributor
Iterating over ComboBox items
I got a custom ComboBox based on TComboBox. I have to work on very basic methods and params.
I need to itterate over Items List somehow. I tried several methods.
itemCount := aqString.GetListLength(pomObj.Items); - this method won't help me, it doesnt work with such parametr
-------------------
itemCount := 0;
while aqConvert.VarToStr(pomObj.Items(itemCount)) <> nil do
begin
itemCount := itemCount + 1;
Log.Message(itemCount);
Log.Message(aqConvert.VarToStr(pomObj.Items(itemCount)));
end;
here I get infinite loop, even I got just 4 items in comboBox. When I log them I get the blank space.
I tried diferent methods of building a condition such as:
while pomObj.Items(itemCount) <> nil do
while pomObj.Items[itemCount] <> nil do
All loops are infinite
What could I do to iterate over those items?
Regards
I need to itterate over Items List somehow. I tried several methods.
itemCount := aqString.GetListLength(pomObj.Items); - this method won't help me, it doesnt work with such parametr
-------------------
itemCount := 0;
while aqConvert.VarToStr(pomObj.Items(itemCount)) <> nil do
begin
itemCount := itemCount + 1;
Log.Message(itemCount);
Log.Message(aqConvert.VarToStr(pomObj.Items(itemCount)));
end;
here I get infinite loop, even I got just 4 items in comboBox. When I log them I get the blank space.
I tried diferent methods of building a condition such as:
while pomObj.Items(itemCount) <> nil do
while pomObj.Items[itemCount] <> nil do
All loops are infinite
What could I do to iterate over those items?
Regards