tubbypascal
Programmer
Hello,
In a Web Application I have to populate 7 combo boxes with the same info. To populate one box I use the following code:
"If IWComboBoxStateProv.ItemIndex = 0 then
begin
IWComboBoxCity1.Items.Insert(0,'Airdrie');
IWComboBoxCity1.Items.Insert(1,'Brooks');
IWComboBoxCity1.Items.Insert(2,'Calgary');
etc...
end
else If IWComboBoxStateProv.ItemIndex = 1 then
begin
IWComboBoxCity1.Items.Insert(0,'Abbotsford');
IWComboBoxCity1.Items.Insert(1,'Armstrong');
etc...
end
else if... etc...etc...."
Some States and Provinces have a LOT of cities. Multiply this by IWComboBoxCity2, IWcomboBoxCity3 etc.. it becomes a rather large amount of coding. Does anyone know or have any ideas as to how I can make this process shorter or more efficient ?
Thanks
In a Web Application I have to populate 7 combo boxes with the same info. To populate one box I use the following code:
"If IWComboBoxStateProv.ItemIndex = 0 then
begin
IWComboBoxCity1.Items.Insert(0,'Airdrie');
IWComboBoxCity1.Items.Insert(1,'Brooks');
IWComboBoxCity1.Items.Insert(2,'Calgary');
etc...
end
else If IWComboBoxStateProv.ItemIndex = 1 then
begin
IWComboBoxCity1.Items.Insert(0,'Abbotsford');
IWComboBoxCity1.Items.Insert(1,'Armstrong');
etc...
end
else if... etc...etc...."
Some States and Provinces have a LOT of cities. Multiply this by IWComboBoxCity2, IWcomboBoxCity3 etc.. it becomes a rather large amount of coding. Does anyone know or have any ideas as to how I can make this process shorter or more efficient ?
Thanks