programming-examples/asp/Miscellaneous/Compare List.asp

24 lines
593 B
Plaintext
Raw Normal View History

2019-11-18 14:25:58 +01:00
Function CompareList(Arg As Variant, ParamArray Values() As Variant) As Boolean
Dim index As Long
If IsObject(Arg) Then
' comparison between objects
For index = 0 To UBound(Values)
If Not IsObject(Values(index)) Then
' argument isn't an object, skip it
ElseIf Arg Is Values(index) Then
CompareList = index
Exit Function
End If
Next
Else
' comparison between non-object values
For index = 0 To UBound(Values)
If IsObject(Values(index)) Then
' argument is an object, skip it
ElseIf Arg = Values(index) Then
CompareList = index
Exit Function
End If
Next
End If
End Function