Module:OutputBuffer: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Jackmcbarn
clear buffer after using
meta>Jackmcbarn
m use the right table
Line 7: Line 7:
local b = buffer
local b = buffer
buffer = nil
buffer = nil
return table.concat(buffer, sep)
return table.concat(b, sep)
end
end
end
end

Revision as of 23:46, 25 June 2014

Documentation for this module may be created at Module:OutputBuffer/doc

return function()
	local buffer = {}
	return function(text)
		buffer[#buffer + 1] = text
	end,
	function(sep)
		local b = buffer
		buffer = nil
		return table.concat(b, sep)
	end
end