1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-01-30 19: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, bClosed = false,
close = function( self ) close = function( self )
end, end,
write = function( self, _sText ) write = function( self, ... )
_G.write( _sText ) local nLimit = select("#", ... )
for n = 1, nLimit do
_G.write( select( n, ... ) )
end
end, end,
flush = function( self ) flush = function( self )
end, end,
@ -117,8 +120,11 @@ function open( _sPath, _sMode )
file.close() file.close()
self.bClosed = true self.bClosed = true
end, end,
write = function( self, _sText ) write = function( self, ... )
file.write( _sText ) local nLimit = select("#", ... )
for n = 1, nLimit do
file.write( select( n, ... ) )
end
end, end,
flush = function( self ) flush = function( self )
file.flush() file.flush()
@ -146,8 +152,11 @@ function open( _sPath, _sMode )
file.close() file.close()
self.bClosed = true self.bClosed = true
end, end,
write = function( self, _number ) write = function( self, ... )
file.write( _number ) local nLimit = select("#", ... )
for n = 1, nLimit do
file.write( select( n, ... ) )
end
end, end,
flush = function( self ) flush = function( self )
file.flush() file.flush()