antonio borraccino
06-14-2007, 09:23 AM
Greetings to all,
Maybe I'm overlooking the obvious here but I can't manage to do something which I think I should be able to do with tables. I'm newby so please forgive my naivety. I've the following table:
tab_def={}
emp01={name="Carlos Freeman", dob="23/12/74", jobTitle="dispatch rider", hobbies="mountain claiming"};
tab_def[emp01]=emp01;
emp02={name="Emma Dobson", dob="02/02/68", jobTitle="dispatch rider", hobbies="cycling"};
tab_def[emp02]=emp02;
emp03={name="Katia Korsacova", dob="04/07/69", jobTitle="post room", hobbies="reading"};
tab_def[emp03]=emp03;
which I add to a listbox:
for k in tab_def do
ListBox.AddItem("list_peo", tab_def[k].name);
end
I would like to be able to select one person from the list and display all info in a single paragraph. All I manage is to dislay the name.
result = ListBox.GetSelected("list_peo");
which_name = ListBox.GetItemText("list_peo", result[1]);
Paragraph.SetText("list_det", which_name);
How can I move forward with this? I'd be grateful for any help.
antonio
Maybe I'm overlooking the obvious here but I can't manage to do something which I think I should be able to do with tables. I'm newby so please forgive my naivety. I've the following table:
tab_def={}
emp01={name="Carlos Freeman", dob="23/12/74", jobTitle="dispatch rider", hobbies="mountain claiming"};
tab_def[emp01]=emp01;
emp02={name="Emma Dobson", dob="02/02/68", jobTitle="dispatch rider", hobbies="cycling"};
tab_def[emp02]=emp02;
emp03={name="Katia Korsacova", dob="04/07/69", jobTitle="post room", hobbies="reading"};
tab_def[emp03]=emp03;
which I add to a listbox:
for k in tab_def do
ListBox.AddItem("list_peo", tab_def[k].name);
end
I would like to be able to select one person from the list and display all info in a single paragraph. All I manage is to dislay the name.
result = ListBox.GetSelected("list_peo");
which_name = ListBox.GetItemText("list_peo", result[1]);
Paragraph.SetText("list_det", which_name);
How can I move forward with this? I'd be grateful for any help.
antonio