Passing array to another module

is this possible? When I

This is menu.lua
[lua]local dataArray = {}
print(dataArray)

function getDataArray()
print(dataArray)
return dataArray
end[/lua]

When I used menu.getDataArray() from another module i cant seem to get the value that is store in this array and when I print array, the address is different.

Its is that when I changeScene to another module, all the variables from the last scene are clean and nil? [import]uid: 40786 topic_id: 15538 reply_id: 315538[/import]

Here’s what I took from your code

local dataArray = {}  
print(dataArray)  
   
function getDataArray()  
 print(dataArray)  
 return dataArray  
end  
  
print(getDataArray())  

and here’s the output that I got

table: 0x1f614180
table: 0x1f614180
table: 0x1f614180

I think you are doing something different somewhere

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 15538 reply_id: 57428[/import]

I used another way to solve my problem but thanks for the help man…!! [import]uid: 40786 topic_id: 15538 reply_id: 57438[/import]