[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Question about using Lua for defining GUIs
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Sat, 11 Jan 2003 09:25:31 -0200
> Component
> { (*** line 39 ***)
> parent = "PlayGUI",
> type = "TextLabel"
> }
>}
>
>
>
>> It doesn't work. Lua complains:
>
>Interesting... without looking at the Lua parser or trying anything, my
>hunch
>is that you're running into a line-end-aware issue introduced with Lua 5.
>
>Try doing the way I suggested, with
> children = { Component { }, Component { } }
That's right, but it has nothing to do with line-ends. In Lua 4.0, you cannot
mix named and anonymous members in tables: you must separate them with a ";":
{ x=1, y=2, z="lua" ; 10, 20, 30 }
In the example in this thread, Component{...} introduces a anonymous member.
So try adding a ";" before it.
In Lua 5.0, you can freely mix members.
--lhf