Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2004
    Location
    Denmark
    Posts
    336

    prob getting table to combobox

    Having some trouble populating a ComboBox with a Table, maybe someone can spot the error. I keep getting an error message saying "Attempt to call Global 'tEnhed' (a table value)"

    This is the code I have:

    On app Startup:
    Code:
    --**********     Create constant Tables START     **********--
    tEnhed = {"Bæver", "Ulv-Toomai", "Ulv-Seeonee", "Junior", "Spejder", "Senior", "Rover", "Leder"};
    On Page OnShow:
    Code:
    --**********     Make sure all fields are empty START     **********--
    ComboBox.DeleteItem("cbEnhed", -1);
    Input.SetText("ipAdresse", "");
    Input.SetText("ipPostnr", "");
    Input.SetText("ipCpr", "");
    Input.SetText("ipIndmeldt", "");
    Input.SetText("ipEfternavn", "");
    Input.SetText("ipFornavn", "");
    Label.SetText("lbCity", "By");
    --**********     Make sure all fields are empty END     **********--
    --Used dialog to make sure the data is in the table
    --  result = Table.Concat(tEnhed, ";", 1, TABLE_ALL);
    --  Dialog.Message("Notice", result, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    
    --**********     Read Constant tables to fields START     **********--
    
    -- Prevent the ComboBox from updating
    	ComboBox.SetUpdate("cbEnhed", false);
    
    -- Add Table to ComboBox
    	nEnhed = Table.Count(tEnhed);
    min = 1;  -- The number to start at
    max = nEnhed;  -- The number to stop at 
    for count = min, max do
    local cEnhed = tEnhed(count);
    Dialog.Message("Notice", cEnhed, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    	--ComboBox.AddItem("cbEnhed", cEnhed, count);
    end
    	ComboBox.SetUpdate("cbEnhed", true);
    I thourght it could have something to do with the table so I tried to take the data from the table and pass it to a string that would then be parsed to the combobox but I get the same error, now its just on the string in stead..

    What am I doing wrong?

    Cheers,
    Jonas

  2. #2
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Try this

    Code:
    local cEnhed = tEnhed[count];
    Dermot

    I am so out of here

  3. #3
    Join Date
    Jul 2004
    Location
    Denmark
    Posts
    336
    of course... I have been looking at this for over an hour trying to get what the error was... and it is so simple...


    Thanks



    Jonas

Similar Threads

  1. Fill ComboBox
    By bobbie in forum AutoPlay Media Studio 6.0
    Replies: 24
    Last Post: 03-04-2006, 03:34 PM
  2. ComboBox Reset
    By azmanar in forum AutoPlay Media Studio 6.0
    Replies: 2
    Last Post: 12-29-2005, 12:46 PM
  3. How do I address a table whose name I know only as a variable?
    By JimS in forum AutoPlay Media Studio 5.0
    Replies: 6
    Last Post: 08-24-2005, 07:37 AM
  4. string / table compare
    By gabrielfenwich in forum AutoPlay Media Studio 5.0
    Replies: 5
    Last Post: 01-29-2005, 11:30 PM
  5. Creating a Table of Contents
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 10-03-2003, 11:35 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