I want to create an associated array for an element used in the definition of properties for a navigation bar. This following works that is not associative:
navBarDefinitions = {
name = “navBar”,
navBarBG = graphics.newGradient(
{ 255, 200, 200 },
{ 200, 70, 70 },
“down” ),
navButtons = { {
navButtonOrder = 1,
navButtonName = NAV_BUTTON_NAME_ADMIN,
navButtonCaption = “Admin”,
navButtonEnabled = true,
navButtonOnRelease = adminProcess
},
{
navButtonOrder = 2,
navButtonName = NAV_BUTTON_NAME_DASHBOARD,
navButtonCaption = “Dashboard”,
navButtonEnabled = true,
navButtonOnRelease = dashboardProcess
}
}
}
What I want to do is make navButtons an associative array where the index is the “constant” string defined in the assignment for navButtonName. (I currently have 7 buttons, but for ease of example, I only included 2)
I then want to be able to access the information as navBarDefninitions.navButtons[NAV_BUTTON_NAME_ADMIN].navButtonOrder, for example.
I have read through so much documentation and tried so many different variations and none have worked so far.
Is this possible? If so then if someone could show me how do to this I would greatly appreciate it! [import]uid: 150008 topic_id: 29585 reply_id: 329585[/import]