Passing an array name to a function, then filling it in
I would like to call a function that takes data and then populates an array that I call in one of the function parameters. An example of what I'm looking for:
function readSaveFile(saveFileName, arrayName)
if love.filesystem.exists(saveFileName) then
arrayName = Tserial.unpack(love.filesystem.read(saveFileName))
end
end
The problem is that instead of creating an array with a string named arrayName, it replaces the parameter with an array explicitly named "arrayName". Is there a way that I could fill in the specified array name?
+3
source to share