Okay... a follow up...
This did not work for me. Gave me a PocketPlotDB is nil error.
Code:
local PocketPlotDB = setmetatable(PocketPlotDB or {}, {__index = defaults})
Added
Code:
PocketPlotDB = PocketPlotDB or {}
in front of it and it worked for everything except the table of r,g,b,a values for my frame's background. Every other subtable (frame positions) worked...
Then again, those subtables (frame positions) do not exist in the defaults table and are only added once the frame is actually moved.
This, modeled after what was shown in WoW Programming, gave me the same result as above. Worked for everything *except* the background color subtable.
Code:
PocketPlotDB = PocketPlotDB or {}
local ppdb = {}
setmetatable(PocketPlotDB, ppdb)
ppdb.__index = defaults
I finally went with conner686's method (since I do it at PLAYER_LOGIN anyhow) and it works perfectly.
Code:
for k,v in pairs(defaults) do
if type(PocketPlotDB[k]) == "nil" then
PocketPlotDB[k] = v
end
end