lua-users home
lua-l archive

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



pachydrm@ix.netcom.com wrote:

> >class Test1
> >{
> >    Test1();
> >    int x;
> >    int y;
> >    int z;
> >};
> >
> >class Test2
> >{
> >    Test2();
> >    int a;
> >    int b;
> >    Test2    c;
> >};
> >
> >
> >
> >at the lua prompt:
> >myclass = Test2:new();
> >
> >--this line does not work
> >myclass.c.x = 5;
> >
> >
> >--i can get around it by
> >temp = myclass.c;
> >temp.x=5;
> >
> >
> >Is this a problem with toLua, or me.  It would be very helpful if this
> worked.
>
> look again; "c" is of type Test2, not Test1 -- there is no "x". :)
>
> jdm

oops, i screwed up it should be:class Test2
{
    Test2();
    int a;
    int b;
    Test1    c;
};

this is not my exact code, but it illustrates the problem, it would take
too long show my actual code.

cameron tofer