Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 1 of 1
  1. #1
    Join Date
    Apr 2007
    Location
    Suffolk, UK
    Posts
    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;
    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:
    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 at 03:16 PM.

Similar Threads

  1. problem returning tables
    By screwed over in forum AutoPlay Media Studio 7.5
    Replies: 5
    Last Post: 03-25-2008, 07:31 PM
  2. creating dynamic tables inside tables...
    By Jonas DK in forum AutoPlay Media Studio 6.0
    Replies: 24
    Last Post: 04-25-2007, 09:56 AM
  3. Problem installing fonts
    By ByronFS in forum Setup Factory 7.0
    Replies: 5
    Last Post: 05-08-2006, 12:23 PM
  4. Always confusing with tables
    By arnaud in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 01-25-2004, 06:33 PM
  5. INFO: Tips for Debugging Action Lists in AutoPlay Media Studio 4.0
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-03-2002, 08:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts