lua-users home
lua-l archive

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


Title: First post: Hierarchal Data storage...

 

 

Yes, see http://doris.sf.net for an example of a binding which allows you to create GUI widgets using the table formatting. The example you give below is calling two functions “Game” and “speech” with a table as an argument:

 

Game {
        speech {
                volume         =19 ,
                subtitles       =true
        } ,
        music                   8
}

To create a table which you can read data out of you could do the following

Game = {
        speech = {
                volume         =19 ,
                subtitles       =true
        } ,
        music                   8
}

With approach one, the “Game” fn could create a game using all of the information in the table passed to it. In example two you could execute the file containing your Lua table and then iterate over it to create everything. Have a look at Doris for an example of method one. Also look at the tutorial I’ve been working on:

http://lua-users.org/wiki/TutorialDirectory

 

http://lua-users.org/wiki/TablesTutorial

 

Nick

 

-----Original Message-----
From: Dave Owens [mailto:DaveO@climax.co.uk]
Sent:
Thursday, September 11, 2003 8:58 AM
To: lua@bazar2.conectiva.com.br
Subject: First post: Hierarchal Data storage...

 

I'm new to LUA, and my first Q is for storing project config data...

Is it possible to store data readable from scripts, and also in a unlimited hierarchal form?

E.g. (bad example)

Game
{
        speech
        {
                volume          19
                subtitles       true
        }
        music                   8
       
}

Dave Owens
 
............................................................................
Aged
Codddddddddddeeeeerrrrrr!!!!!!!
.....Creaky Creaky.....

............................................................................
CLIMAX Solent
Somerville Office
North Promenade Building
Gunwharf Quays
Portsmouth
PO1 3TT
(023) 9286 3675
......................................