Forum
![>](img/i_next.png)
![>](img/icons/cs2d.png)
![>](img/i_next.png)
![>](img/i_next.png)
highest value in table
8 replies![To the start](img/i_first.png)
![Previous](img/i_prev.png)
![Next](img/i_next.png)
![To the start](img/i_last.png)
![](img/smiles/bigsmile.gif)
I think it works with math.max but idk the parameter...
![](img/smiles/thoughtfully2.gif)
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
function tablemax(t) 	if t==nil then return 0 end 	if #t==0 then return 0 end 	max=t[1] 	for i=2,#t do 		if t[i]>max then 			max=t[i] 		end 	end 	return max end
untested
![user](img/i_friend.png)
1
2
3
2
3
function tablemax(t) 	return math.max(unpack(t)) end
Would that work?
(In reply to
![user](img/i_friend.png)
That should work fine
![](img/smiles/bigsmile.gif)
![To the start](img/i_first.png)
![Previous](img/i_prev.png)
![Next](img/i_next.png)
![To the start](img/i_last.png)