OK, i officially hate tables now. im getting an error with this code (in globals):
im using this code to call it from on Preload:
and heres my error message:
i hope thats enough information for you guys. as usual any help would be immensly appreciated.
Code:
function LoadDeck(user) ldTable = {} ldTable.Deck = {} cDecks = INIFile.GetValue(sFold..User.."\\decks.ini", "Decks", "Count"); ldTable.dCount = cDecks; for d=1, cDecks, 1 do dName = INIFile.GetValue(sFold..User.."\\decks.ini", "Decks", "Deck"..d); ldTable.Deck[d] = dName; [COLOR="Red"]line 79->[/COLOR] ldTable.Deck[d].Card = {} dcCount = INIFile.GetValue(sFold..User.."\\decks.ini", dName, dName.." Count"); ldTable.Deck[d].Count = dcCount; for c=1, dcCount, 1 do cData = INIFile.GetValue(sFold..User.."\\decks.ini", dName, "Card"..c); ldTable.Deck[d].Card[c] = cData; end end return ldTable end
Code:
if deck.Deck[1].Card[1] ~= nil then Dialog.Message("Notice", deck.Deck[1].Card[1], MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); else Dialog.Message("Notice", "error", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); end
Code:
on Preload, Line 79: attempt to index field '?' (a sting value)