PDA

View Full Version : Simple question from a simple mind


brdga
06-23-2004, 01:54 AM
Can anyone tell me what is wrong with this? The file is created but it has no content although I know the indexes in the listbox have associated data. Any help appreciated.

-- Get the indexes of the items currently selected in the listbox.
-- and get the data associated with that index
selected = ListBox.GetSelected("LB1");
sel_data = ListBox.GetItemData("LB1", selected);

-- write the data to a text file
TextFile.WriteFromString("C:\\Data.txt", sel_data, true);

Stefan_M
06-23-2004, 05:07 AM
ListBox.GetSelected("LB1"); returns a table containing all selected items

--change
sel_data = ListBox.GetItemData("LB1", selected);
--to
sel_data = ListBox.GetItemData("LB1", selected[1]);

brdga
06-24-2004, 03:28 AM
Oops. Stupid tables. Thanks man.

TJ_Tigger
06-24-2004, 09:00 AM
Oops. Stupid tables. Thanks man.

If I had a dollar for every time I said that. . .