Compare values of two arrays - classic asp
arrays, asp-classic, comparison, vbscript
Solution
Dim array1(3)
Dim array2(2)
array1(0) = 85
array1(1) = 459
array1(2) = 90
array2(0) = 459
array2(1) = 90
Dim i 'As Integer
Dim j 'As Integer
Dim isFound 'As Boolean
For i = 0 To UBound(array1) - 1
isFound = False
For j = 0 To UBound(array2) - 1
If array1(i) = array2(j) Then
isFound = True
End If
Next 'j
If Not isFound Then
Response.Write array1(i) & " not found<br />"
End If
Next 'i
Problem
How can I Compare values of two arrays to check if 1 array does not have an element of another array for example - ``` array1(0) = 85 array1(1) = 459 array1(2) = 90 array2(0) = 459 array2(1) = 90 ``` I want to return the values that are not present in the second array? I tried with double for loops but didn't work out to well for me.