View Single Post
  #3  
Unread 01-26-2011, 11:11 PM
MuNkEy MuNkEy is offline
The Wary
Interface Author - Click to view interfaces
 
Join Date: Jan 2011
Posts: 2
Just an update in case it helps anyone in the future...

I solved this by adding the split function
Code:
function split(pString, pPattern)
	local Table = {} -- NOTE: use {n = 0} in Lua-5.0
	local fpat = "(.-)" .. pPattern
	local last_end = 1
	local s, e, cap = pString:find(fpat, 1)
	while s do
		if s ~= 1 or cap ~= "" then
			table.insert(Table,cap)
		end
		last_end = e+1
		s, e, cap = pString:find(fpat, last_end)
	end
	if last_end <= #pString then
		cap = pString:sub(last_end)
		table.insert(Table, cap)
	end
	return Table
end
once you have that function, you can split the string to an array with
Code:
function Execute(cmd, args)
	args = split(args, " ");
end
Reply With Quote