I have a question regarding the handling of requiring a file:
I have a module with a function, like this
local mod={} local createStuff = function() local decide=math.random(1,2) local theFile if decide==1 then theFile=require ("infofiles.randomfile\_2") else theFile=require ("infofiles.randomfile") end end mod.createStuff = createStuff return mod
I require the module in a scene, then call createStuff() inside this scene.
Now I wonder if the code above in the modules function is okay and if the local required theFile is correct regarding memory handling? Is there anything negative about doing it like this?
Thanks for your help!