I am trying to setup a user property in a menu form by populating a table, then creating a long string out of it and using this string as a list of choices in user_prop_add_enum(), but to no avail.
Pulling my hair on this one, can you point me to where I made a mistake?
I don't have any error message, but the menu is not populated, except for the explicitly described default value
in choice_prop = user_prop_add_enum("Event", lestring, "ZOOM_OUT", "You can choose one of these Events")
Or does that mean that user_prop_menu() does not allow this?
The table is properly populated, so this is NOT a csv issue.
The string lestring seems correct when printed, but is not used in the user_prop() function
Code: Select all
-- liste des events.csv is location in the resources folder
data = static_data_load("liste des events.csv", "csv_header=true")
events={}
lestring=" " -- String of available events
if data ~= nil then
for key,value in pairs(data) do
print(key.." "..value["Events"]) -- verification purpose
events[key]=value["Events"]
lestring=lestring..","..(events[key])
end
end
print(lestring) -- verification purpose, the string is correctly completed ?????
choice_prop = user_prop_add_enum("Event", lestring, "ZOOM_OUT", "You can choose one of these Events")
Jacques