so
local function test.read() doSomething() endwould throw an error something along the lines of
bios.lua:14: [string "code"]:1: '(' expected
is there a way around this w/o excluding the period? or nah?
Posted 30 January 2017 - 05:15 AM
local function test.read() doSomething() endwould throw an error something along the lines of
Posted 30 January 2017 - 06:28 AM
local test = { }
test.read = function()
--# do something
end
Edited by Dog, 30 January 2017 - 06:30 AM.
Posted 30 January 2017 - 09:06 AM
Posted 30 January 2017 - 09:48 PM
Dog, on 30 January 2017 - 06:28 AM, said:
local test = { }
test.read = function()
--# do something
end
local test = {}
function test.read()
--# do something
end
It looks a bit nicer imo, and is closer to what you wrote yourself.Posted 31 January 2017 - 12:17 AM
Posted 31 January 2017 - 05:17 PM
local function f() end
local t = {}
t[f] = "f"
t[error] = "error"
print( t[f] ) --#> f
print( t[error] ) --#> error
0 members, 2 guests, 0 anonymous users