... or if you wanted the syntax to be a little cleaner ...
code:
Function udfIntMax($vString)
Dim $iSubscript
Dim $vArray $vArray=Split($vString,",")
$udfIntMax=Val($vArray[0])
For $iSubscript=1 To UBound($vArray)
If Val($vArray[$iSubscript]) > $udfIntMax $udfIntMax=Val($vArray[$iSubscript]) EndIf
Next
Return
EndFunction


And call it like this:
code:
$iNumber=99
$iMaxNo=udfIntMax("1,2,3,4,$iNumber,4,3,2,1")
"Largest number is " $iMaxNo ?

[ 23 January 2002: Message edited by: Richard Howarth ]