[SomeMeasure]
FileTypes=.jpg|.png|.bmp
You will need some way to split that string into individual parts. This little Lua function, which you can stick at the bottom of your script, will take care of this for you. It will split the string on the "|" delimiter (or any delimiter pattern you define) and return a table with the separate elements.
Code: Select all
function split(str, pat)
local t = {}
local fpat = "(.-)" .. pat
local last_end = 1
local s, e, cap = str:find(fpat, 1)
while s do
if s ~= 1 or cap ~= "" then
table.insert(t,cap)
end
last_end = e+1
s, e, cap = str:find(fpat, last_end)
end
if last_end <= #str then
cap = str:sub(last_end)
table.insert(t, cap)
end
return t
end -- function split
tExtensions = split(sFileTypes, "|")
and you will have a table tExtensions with tExtensions[1] being ".jpg", tExtensions[2] being ".png", and tExtensions[3] being ".bmp".
Your "pattern / delimiter" can be anything, and is not limited to a single character.