[JW Lua] Button press callback

Charles O. Lawrence charlesolawrence at bellsouth.net
Wed Nov 18 21:06:43 CET 2015


> Also, how can you define mybutton as local and yet it is in the scope 
> of the callback function?

"mybutton" is defined before the function, with file scope.


Best regards,

Jari Williamsson

+++++++++++++++++++++++++++++++++++++++++++++++++

Jari,
Thanks for the info.

I usually place all my functions at the top of the file, which necessitates
declaring variables later on as global.  I can see the value of putting
functions later in the middle of the code, but it just seems odd to me.  If
I place the function at the bottom, then no matter if the variable is global
or local, the button press does nothing.  Why?

Charles


_______________________________________________
JWLua mailing list
JWLua at jwmusic.nu
http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu





More information about the JWLua mailing list