1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-01-28 18:04:47 +00:00

Merge pull request #440 from Wilma456/ComputerCraft-1/iomulti

Make io.write() accept multiple args
This commit is contained in:
SquidDev 2017-11-15 11:47:33 +00:00
commit 6c29b44c3c

View File

@ -23,8 +23,11 @@ local g_defaultOutput = {
bClosed = false,
close = function( self )
end,
write = function( self, _sText )
_G.write( _sText )
write = function( self, ... )
local nLimit = select("#", ... )
for n = 1, nLimit do
_G.write( select( n, ... ) )
end
end,
flush = function( self )
end,
@ -117,8 +120,11 @@ function open( _sPath, _sMode )
file.close()
self.bClosed = true
end,
write = function( self, _sText )
file.write( _sText )
write = function( self, ... )
local nLimit = select("#", ... )
for n = 1, nLimit do
file.write( select( n, ... ) )
end
end,
flush = function( self )
file.flush()
@ -146,8 +152,11 @@ function open( _sPath, _sMode )
file.close()
self.bClosed = true
end,
write = function( self, _number )
file.write( _number )
write = function( self, ... )
local nLimit = select("#", ... )
for n = 1, nLimit do
file.write( select( n, ... ) )
end
end,
flush = function( self )
file.flush()