John,

..NET has System.Math.Max that will find the max of two numbers, you can

write a Max that accepts any number of numbers using a ParamArray parameter.

Something like:

' VS.NET 2003 syntax

Function Max(ByVal ParamArray values() as Integer) As Integer

Dim result As Integer = Integer.MinValue

For Each value As Integer In values

result = Math.Max(result, value)

Next

Return result

End Function

Of course you can overload the above function for other types, such as Long,

Short, Byte, Single, Double, Decimal.

When we get VS.NET 2004 (Whidbey) we can write the above using Generics

which means the compiler will automatically overload for us!

Hope this helps

Jay

"John A Grandy" <johnagrandy-at-yahoo.com> wrote in message

news:u%****************@TK2MSFTNGP12.phx.gbl...

does .NET have a Max() function ?

something like

MyMaxValue = Max(Value1,Value2,Value3,Value4)