you could do it in 4 if statments
if [ {(1<2) and (1<3) and (1<4)}
set smallest to 1
]
if [ {(2<1) and (2<3) and (2<4)}
set smallest to 2
]
if [ {(3<2) and (3<1) and (3<4)}
set smallest to 3
]
if [ {(4<2) and (4<3) and (4<1)}
set smallest to 4
]
1 = variable 1
2 = variable 2
3 = variable 3
4 = variable 4
smallest = the smallest varable.
This would do it in four if statments.
Offline