Thanks Milind and Antonio,
I'll have to study that up.
Regards,
John
On 10/07/2015 1:40 p.m., Milind Gupta wrote:
The explanation is here :
http://www.lua.org/manual/5.3/manual.html#3.4.11
Function definition is like this actually:
functiondef ::=*function* funcbody
funcbody ::= ‘*(*’ [pa
I did a few more tests.
x = {}
x["y"] = 3
print(x.y) -- 3
x["f1"] = 4
print(x.f1) -- 4
x["3"] = 4
--print(x.3) -- invalid
print(x[3]) -- nil
print(x["3"]) -- 4
Quite expected. Then more tests:
box = {}
key = "xxx"
box.yyy = {numcol=3}
box[key] = {numcol=2}
function box.yyy:click_cb(L,C)
e
Interesting.
This also does not work:
function box[key].click_cb(self, L,C)
And it is not related to IupLua. I tested with:
box[key]= {numcol=2, numcol_visible=2, numlin=0}
An the result is the same.
It seems it is not a valid Lua declaration. You should post at the Lua
list to get a
The explanation is here : http://www.lua.org/manual/5.3/manual.html#3.4.11
Function definition is like this actually:
functiondef ::= *function* funcbody
funcbody ::= ‘*(*’ [parlist] ‘*)*’ block *end*
So in your example this works:
box[key].click = function(self,L,C)
end
The other way is just
Hi,
I've been doing a bit of programming with IUP LUA under windows.
And have discovered this oddness.
===
require( "iuplua" )
require( "iupluacontrols" )
box = {}
key = "999"
box[key]= iup.matrix {numcol=2, numcol_visible=2, numlin=0}
local box_key = box[key]-- This works
functio