Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Posts
    163

    Huh? Table.Concat not working with FileMenu?

    Hi! I tried to get the Menubar in a var(table) and then display the content as string in a textbox but I get this runtime error.

    [3]: tblFileMenu = Application.GetMenu();
    TRACE: LastError = 0 ("Success.")
    [2]: result = Table.Concat(tblFileMenu, ";", 1, TABLE_ALL);
    TRACE: LastError = 2901 ("A runtime error occurred while calling the function.")
    [4]: Input.SetText("Input1", result);
    TRACE: LastError = 0 ("Success.")

    Does anyone know why it does not work?

  2. #2
    Join Date
    Jun 2004
    Posts
    75
    This is basically from the help file I tested it and works on AMS7 here.

    Code:
    -- Output all top level menu items:
    local strMenuData = "";
    
    -- Store the contents of the menu in a table
    tblMenu = Application.GetMenu();
    
    -- Check that the table exists
    if(tblMenu)then
      local nNumItems = Table.Count(tblMenu);
    
      -- Step through the table row by row
      for index = 1, nNumItems do
          local tblItemInfo = tblMenu[index];
          if(tblItemInfo)then
              -- Add the text to the string
              strMenuData = strMenuData..tblItemInfo.Text.."\r\n";
          end
      end
    
      -- Output the created string to the user
    Input.SetText("Input1", strMenuData);
    end
    I added the Input field for the sake of this example.
    Human Relativity: No one is alike, which is what makes us alike, at any given time. --Myself

Similar Threads

  1. Working with Tables and Files
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 12-23-2003, 08:22 AM
  2. The ? char code is not working
    By Marker0077 in forum Setup Factory 6.0
    Replies: 7
    Last Post: 06-21-2003, 04:04 PM
  3. Set working directory
    By imanta in forum Setup Factory 6.0
    Replies: 1
    Last Post: 05-16-2003, 12:39 PM
  4. File - execute -> Working Directory
    By mtway in forum AutoPlay Media Studio 4.0
    Replies: 5
    Last Post: 12-10-2002, 01:40 PM
  5. "Wait for Return" not working
    By davidangell in forum AutoPlay Menu Studio 3.0
    Replies: 1
    Last Post: 02-13-2002, 10:30 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