lua-users home
lua-l archive

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


The idea of the program is to use loadfile to load the functions as entries in the table currentPage. what I don't understand is that when I empty 'currentPage' by assigning NIL, and then loading another set of functions into the table 'currentPage', how is it possible that when I do that several times the program will crash?

The only thing I can think of is that 'currentPage' is set to nil and loaded with data again from within a function that is part of the currently available functions within 'currentPage', and it is that which is causing some problems

any idea's?.  

Met vriendelijke groet

Guido ter Horst
+32 499 708000

On Sun, Jul 5, 2015 at 6:18 PM, Parke <parke.nexus@gmail.com> wrote:
On Sun, Jul 5, 2015 at 5:04 AM, Guido ter Horst
<g.terhorst@tabbasoum.com> wrote:
> im new to LUA and using it for the Taranis model airplane transmitter, a
> hobby project.
>
> Im trying to write a custom menu for setting only the parameters in the
> radio I want to change.
>
> Im kind of stuck: i have set up a basic menu, and once you pick a page
> listed it will load that page.if you hit another button, it will return to
> the picklist again.
>
> However, although all pages load for the first time, it will always crash
> after load for the second or third time. It must be somthing with upvalues
> created where I dont see them??
>
> Any help possible would be appreciated.

You might want to ask whomever provided you the software.

> lcd.drawText( 150, 2, pages.title, DBLSIZE )
>     lcd.drawText( 140, 20, menus[currentMenu].name,0 )
>     lcd.drawText( 162, 56, "version " .. version, SMLSIZE)

lcd.drawText is not a standard Lua function.

The standard Lua functions are documented here:

http://www.lua.org/manual/5.3/contents.html#index

What happens on a "crash"?  Can you view a stack trace?

-Parke