problem constructing tables.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • screwed over
    Forum Member
    • Apr 2007
    • 176

    problem constructing tables.

    OK, i officially hate tables now. im getting an error with this code (in globals):
    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
    im using this code to call it from on Preload:
    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
    and heres my error message:
    Code:
    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.
    Last edited by screwed over; 03-26-2008, 03:16 PM.
Working...
X