Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Explicit
Function Min(a, b, c, d, e, f)
'Compares 1 to 6 arguments, returns the
'one with the smallest value. Just leave
'out arguments you do not have.
'Last arg must be present to avoid a
'VBScript syntax error.
'Bad example:
' j = Min(1, , , ,7, )
'Good Example:
' j = Min(1, , , , ,7)
Dim args, i
args = Array(a, b, c, d, e, f)
For i = 0 To 5
If VarType(args(i)) <> vbError Then
If VarType(Min) <> vbEmpty Then
If args(i) < Min Then Min = args(i)
Else
Min = args(i)
End If
End If
Next
End Function
Function Min2(a, b)
If a < b Then Min2 = a Else Min2 = b
End Function
MsgBox CStr(Min(1, , , , ,7))
MsgBox CStr(Min(7, , , , ,1))
MsgBox CStr(Min( , ,1, , ,7))
MsgBox CStr(Min( ,-2,1, , ,7))
MsgBox CStr(Min( ,"a","A", , ,"Z"))
MsgBox CStr(Min2(5,-3))