Hello,
Im looking to copy data from a table into the item data in a combobox.
I have been able to read out the data in the table using for loops but having some trouble,
i wish to take the values in position 1 of the table and copy to the item data position 1 of the combobox,
then same for 2,3,4 ....etc. the number of items in the table will vary but ill use a count for this later.
here is my code so far. not doing quite what i want but somebody may be able to spot the error in my ways.
i belive the bold part is where ive mostly messed up
for reference the name "cameras" is the name of my combobox
thanks
Im looking to copy data from a table into the item data in a combobox.
I have been able to read out the data in the table using for loops but having some trouble,
i wish to take the values in position 1 of the table and copy to the item data position 1 of the combobox,
then same for 2,3,4 ....etc. the number of items in the table will vary but ill use a count for this later.
here is my code so far. not doing quite what i want but somebody may be able to spot the error in my ways.
i belive the bold part is where ive mostly messed up
for reference the name "cameras" is the name of my combobox
thanks
Code:
addresses_table = TextFile.ReadToTable("AutoPlay\\Docs\\ip.txt"); addresses_count = Table.Count(addresses_table); Dialog.Message("Notice", "number of cameras found = "..addresses_count.."", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); min = 1; max = 3; step= 1; num= 0; Debug.ShowWindow(true); Debug.SetTraceMode(true); for i,v in pairs(addresses_table) do for count = min, max, step do [B] ComboBox.InsertItem("Cameras", num, ""..v.."", ""); num= num+1;[/B] end --Dialog.Message("Notice", ""..i.." "..v.."", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); end end
Comment