Yes that would work as MS = {} is a global table available to all addons, but each file would only be able to access the MS one, so you would have to add that local line in each file if you want to reference it in the same way.
File 1:
-- Create or use the existing table
UniqueName_MS = UniqueName_MS or {}
-- Create a local reference to the table
local thisMS = UniqueName_MS
File 2:
-- Create or use the existing table
UniqueName_MS = UniqueName_MS or {}
-- Create a local reference to the table
local thisMS = UniqueName_MS
Something like this near the top of your files will simulate an addon wide variable but it is in essence a global variable for all addons to access, so bear that in mind.
|