I'm trying to use the Penlight library as follows:
Code: Select all
if not fhloadrequire("pl","pl.init") then return end -- Load required Penlight modules using the snippet from FHUG wiki
pl = require("pl.import_into")
dir = require ("pl.dir")
pluginDir = fhGetPluginDataFileName("LOCAL_MACHINE",true)
function SetDatFileLists() --populate a list
tblDatList= dir.getfiles(pluginDir, ".*\\(.-)\.dat") --get list of .dat files in the plugin data directory
if tblDatList ~= nil then
iup.SetAttribute (listX, "REMOVEITEM", "ALL")
for i = 1,#tblDatList do
iup.SetAttribute (listX, "APPENDITEM", tblDatList[i])
end
end
end
It's passing the test (as expected)
Code: Select all
if tblDatList ~= nil then
Code: Select all
for i = 1,#tblDatList do
What stupid thing am I doing wrong?