1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-13 11:40:29 +00:00

Merge pull request #440 from Wilma456/iomulti

Make io.write() accept multiple args
This commit is contained in:
Daniel Ratcliffe 2018-01-13 00:48:07 +00:00 committed by GitHub
commit 8d356f50c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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,
@ -115,8 +118,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()
@ -144,8 +150,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()