lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Feb 23, 2006, at 16:31, Gavin Kistner wrote:

Not directly, no. Yes, I can grab 'a', and 'b' directly, but I can't use the (unknown) number of later values unless I shift the table down.

	local results = { func() }
	local a = table.remove( results, 1 )
	local b = table.remove( results, 1 )
	return 'x', unpack( results )

As mentioned somewhere else, you can tell unpack where to start:

return unpack( results, 3 )

Alternatively, in your specific case, you could always split your call between find() and match():

if aPath:find( aPattern ) ~= nil then
    local someMatches = { aPath:match( aPattern ) }


PA, Onnay Equitursay