[JW Lua] Combining NumberedList and Number in the dialog

Jan Angermüller jan at angermueller.com
Tue Sep 9 13:22:14 CEST 2014


Jari,

is it possible to combine NumberedList and Number types in the dialog ?
I was successful in creating several NumberedList entries OR several 
Number entries for the dialog,
but was not successful in the combination of them:
When I use NumberedList, Number, NumberedList, Number,
dialog:Execute() returns the error message "Non-number in a list item of 
a "Number" type".

When setting the lists with SetLists, I add an array for the 
NumberedList and a nil for the Number.

The code snippet is below.

Jan

local dialogTypes={}
local dialogLists={}
local dialogDescriptions={}
local dialogInitValues={}

local displaylist = {"aa","bb"}
local numelements=3
local i=1
while i <= numelements do
     table.insert(dialogTypes,"NumberedList")
     table.insert(dialogTypes,"Number")
     table.insert(dialogLists,displaylist)
     table.insert(dialogLists,nil)
     table.insert(dialogDescriptions,i..".) Element 1")
     table.insert(dialogDescriptions,i..".) Element 2")
     table.insert(dialogInitValues,1)
     table.insert(dialogInitValues,1)
     i=i+1
end

local dialog = finenv.UserValueInput()
dialog.Title = "Dialog title"
dialog:SetTypes(dialogTypes)
dialog:SetLists(dialogLists)
dialog:SetDescriptions(dialogDescriptions)
dialog:SetInitValues(dialogInitValues)
local returnvalues = dialog:Execute()






More information about the JWLua mailing list