~~Nobump: Thanks for the replies.
KingofGamesYami, on 18 July 2015 - 02:13 AM, said:
I know, that's why it's funny. It's making fun of people who do that.
Edited by Geforce Fan, 19 July 2015 - 05:46 PM.
Posted 17 July 2015 - 09:37 PM
KingofGamesYami, on 18 July 2015 - 02:13 AM, said:
Edited by Geforce Fan, 19 July 2015 - 05:46 PM.
Posted 17 July 2015 - 10:20 PM
Edited by Lignum, 17 July 2015 - 10:32 PM.
Posted 18 July 2015 - 01:32 AM
Lignum, on 17 July 2015 - 10:20 PM, said:
Posted 18 July 2015 - 10:27 AM
local environments = {}
function loadfile( file )
local content = readfile( file ) -- I'm assuming you can do this part yourself (' to fix forum syntax highlighting)
local f, err
local env = setmetatable( {}, { __index = function( t, k ) return environments[f][k] end, __newindex( t, k, v ) environments[f][k] = v end } )
f, err = load( content, fs.getName( file ), nil, env )
if not f then return false, err end
environments[f] = getfenv( 2 ) -- the caller's environment, because that's generally what you want?
return f
end
function setfenv( f, env )
environments[f] = env
end
function getfenv( f )
return environments[f]
end
Edited by awsumben13, 18 July 2015 - 10:29 AM.
Posted 19 July 2015 - 02:28 AM
Lignum, on 17 July 2015 - 10:20 PM, said:
0 members, 1 guests, 0 anonymous users