[Iup-users] bug with iup and table insert?
Antonio Scuri
scuri at tecgraf.puc-rio.br
Wed Oct 10 11:36:08 GMT+3 2007
I changed your code to:
button = iup.button{title = "table.insert()"} function button.action()
test = {}
print(test, test[1])
table.insert(test, 1)
print(test, test[1])
return iup.DEFAULT
end
dlg = iup.dialog{button}
dlg:popup(iup.CENTER, iup.CENTER)
And run it from the standard IupLua console in Windows. It outputs:
table: 027F1410 nil
table: 027F1410 1
As expected.
Maybe you are getting regular Lua errors but the error handler is bad.
Best,
scuri
> -----Original Message-----
> From: iup-users-bounces at lists.luaforge.net
> [mailto:iup-users-bounces at lists.luaforge.net] On Behalf Of Merick
> Sent: quarta-feira, 10 de outubro de 2007 11:11
> To: IUP discussion list.
> Subject: Re: [Iup-users] bug with iup and table insert?
>
> Antonio Scuri wrote:
> > I took a look at your first example but it was too big.
> >
> > Can you make a more simple example so I can debug the
> situation here?
> >
> > Best,
> > scuri
> >
> >
> Here, try this one:
>
> button = iup.button{title = "table.insert()"} function button.action()
> test = {}
> table.insert(test, 1)
> return iup.default{}
> end
>
> dlg = iup.dialog{button}
>
> dlg:popup(iup.CENTER, iup.CENTER)
>
> iup.MainLoop()
>
>
> When I run this script, it will pop up the dialog with the
> button, but when you click the button it crashes my interpreter
>
> _______________________________________________
> iup-users mailing list
> iup-users at lists.luaforge.net
> http://lists.luaforge.net/cgi-bin/mailman/listinfo/iup-users
>
More information about the iup-users
mailing list