I’ve got figurative bruises from banging my head against my keyboard on this one…
In one module I pass a table (dashboardSheetData) to two other modules as part of their constructors:
local clockClass = require("clock")
local bonusClass = require("bonus")
...
clock = clockClass.new(dashboardSheetData, dashboardImageSheet, storyboard.roomData.time)
bonus = bonusClass:new(dashboardSheetData, dashboardImageSheet)
The first (clock) works fine, but I was getting null errors when trying to access data in the table in the other module (bonus).
So, I iterated through the passed table in each of the two other modules (clock & bonus). Here’s what I got in the terminal:
[text]
dashboardSheetData in clock–
getFrameIndex function: 0x1007f2070
getSheet function: 0x102177360
frameIndex table: 0x1021767e0
sheet table: 0x10c5a9960
dashboardSheetData in bonus–
checkForNewBonus function: 0x10c5b1550
new function: 0x10c5b14e0
[/text]
In clock it looks good, but in bonus it’s as if I had passed it itself (i.e. checkForNewBonus & new are functions in bonus). What?!
If it’s helpful, here’s the start of the new function in clock:
function clock.new(dashboardSheetData, dashboardImageSheet, time)
print ("dashboardSheetData in clock--") --testing
for key,value in pairs(dashboardSheetData) do print(key,value) end --testing
print ("") --testing
And the start of the new function in bonus:
function bonus.new(dashboardSheetData, dashboardImageSheet)
print ("dashboardSheetData in bonus--") --testing
for key,value in pairs(dashboardSheetData) do print(key,value) end --testing
print ("") --testing
Anyone have ANY idea about what’s going on? I’m stumped.
Conan. [import]uid: 136105 topic_id: 33660 reply_id: 333660[/import]