-- Purely for string returning functions.

local function ConcatenateValuesWithSeparators(separator,inval,inval2,...)
	if inval ~= nil and inval2 ~= nil then
		separator = MatchReplace(separator,"")
		if not IsStringToBool(inval) then inval = tostring(inval) end
		if not IsStringToBool(inval2) then inval2 = tostring(inval2) end
		return ConcatenateValuesWithSeparators(separator,inval .. separator .. inval2,...)
	else
		if inval ~= nil then
			if not IsStringToBool(inval) then inval = tostring(inval) end
			return inval
		end
	end
end

local function TableToString(depth,intbl)
	if IsNumberToBool(depth) then
		if depth < 0 then return end
	end
	if IsTableToBool(intbl) then
		local outstr = "{"
		for i=1, TableLength(intbl) do
			if IsTableToBool(intbl[i]) then
				local dive
				if IsNumberToBool(depth) then
					dive = depth - 1
				end
				local result = TableToString(dive,intbl[i])
				if result ~= nil then
					outstr = outstr .. TableToString(dive,intbl[i])
				else
					return
				end
			else
				if IsStringToBool(intbl[i]) then
					outstr = outstr .. "\"" .. intbl[i] .. "\""
				else
					outstr = outstr .. tostring(intbl[i])
				end
			end
			if i ~= TableLength(intbl) then outstr = outstr .. "," end
		end
		return outstr .. "}"
	end
end

local function ValueToString(inval,depth)
	if IsTableToBool(inval) then
		return TableToString(MatchReplace(depth,500),inval)
	else
		return tostring(inval)
	end
end

local function RecursiveTableToString(depth,inval,...)
	if IsTableToBool(inval) then
		return TableToString(depth,inval) .. "\n" .. RecursiveTableToString(depth,...)
	else
		return ""
	end
end

local a = {}
