1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-08-07 22:33:52 +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, 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,
@ -115,8 +118,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()
@ -144,8 +150,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()