Hi,
I’am not sure to understand module insertion.
I have a main.lua with :
local a= 3
local b= 4
paquet = require "paquet01"
local c = paquet:produit(a,b)
print (a.." x "..b.."=".."c")
and a module file, named “paquet01.lua” :
module(..., package.seeall)
function produit(a,b)
c=a\*b
return c
end
The error code says :
[blockcode]
paquet01.lua:4: attempt to perform arithmetic on local ‘a’ (a table value)
[/blockcode]
I do not understand why “a” is a table and how to pass variable to a function in another lua file.
[import]uid: 5578 topic_id: 20992 reply_id: 320992[/import]