lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Use "Menu" instead of Menu. Then, at run time, you can resolve the name "Menu" to the object under it. 

        ["Back"] = "Menu"                      <-- No problem :)

-----Original Message-----
From: Speight.Marcus [mailto:marcus.speight@vivid-gaming.com]
Sent: Tuesday, October 14, 2003 3:51 AM
To: LUA (E-mail)
Subject: Forward Declaration

Hi,

I'm fairly new to LUA and hoped someone could answer a problem for me.

I have a menu system that loads an lua script. But I need a menu to back
reference.

e.g.

SubMenu1 =
{
        ["New Campaign"] = ID_CAMPAIGN,
        ["New Random Map"] = ID_RANDOMMAP,
        ["Back"] = Menu                      <-- Problem
};

Menu =
{
        ["New"] = SubMenu1,
        ["Load Game"] = ID_LOADGAME,
        ["Exit"] = ID_EXIT
};

I tried adding Menu = {}; at the beginning of the file but it did not help.
How to I do this?


Marcus Speight
Software Engineer
Vivid Gaming

The views expressed in this message are those of the sender and not
necessarily those of IGT - UK Limited and its associated companies.