Indigo Rose Software
  #1  
Old 11-10-2007
SonG0han SonG0han is offline
Forum Member
 
Join Date: Dec 2003
Posts: 155
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?
Reply With Quote
  #2  
Old 11-10-2007
madsen's Avatar
madsen madsen is offline
Indigo Rose Customer
 
Join Date: Jun 2004
Posts: 14
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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Working with Tables and Files Desmond AutoPlay Media Studio 5.0 Examples 0 12-23-2003 09:22 AM
The ? char code is not working Marker0077 Setup Factory 6.0 7 06-21-2003 05:04 PM
Set working directory imanta Setup Factory 6.0 1 05-16-2003 01:39 PM
File - execute -> Working Directory mtway AutoPlay Media Studio 4.0 5 12-10-2002 02:40 PM
"Wait for Return" not working davidangell AutoPlay Menu Studio 3.0 1 02-13-2002 11:30 AM


All times are GMT -6. The time now is 11:20 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software