screwed over
03-26-2008, 04:07 PM
OK, i officially hate tables now. im getting an error with this code (in globals):
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;
line 79-> 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
im using this code to call it from on Preload:
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
and heres my error message:
on Preload, Line 79: attempt to index field '?' (a sting value)
i hope thats enough information for you guys. as usual any help would be immensly appreciated.
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;
line 79-> 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
im using this code to call it from on Preload:
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
and heres my error message:
on Preload, Line 79: attempt to index field '?' (a sting value)
i hope thats enough information for you guys. as usual any help would be immensly appreciated.