lua-users home
lua-l archive

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


if C is 2, your array is [2] elements long, so you only have array[0]
and array[1].. array[C] is, in fact, out of range (which is funny
because C arrays never worked right on tolua++, but in this case it's
working).

On Nov 25, 2007 1:00 PM, Luo Hei <luo_hei@yahoo.es> wrote:
> I have generated wrapper code with tolua to access my C++ classes. But I
> have found a problem.
> Lets suppose I have the following:
>
> enum Indexer {
>   A=0, B, C
> }
>
> class test {
> int array{C}
> }
>
> In lua scripts, using array[A]=something works fine. But if I use
> array[C]=something I got an error message about indexing out of range.
> How can I solve this? A quick and dirty workaround is to add an extra
> element to all arrays as filler, so C is no longer the last index.
>
>
>
> --
> http://dsgp.blogspot.com | Linux, programación, juegos
> Have no place I can be since I found Serenity
> But you can't take the sky from me
>
>
> ______________________________________________
> LLama Gratis a cualquier PC del Mundo.
> Llamadas a fijos y móviles desde 1 céntimo por minuto.
> http://es.voice.yahoo.com
>