Discuss easy removel of items in array in the Code Bank forum on ASP Free. easy removel of items in array Code Bank forum containing sample code and scripts to help solve common problems. Take a look and use the code to assist in your projects.
Posts: 668
Time spent in forums: 6 Days 7 h 4 m 19 sec
Reputation Power: 24
easy removel of items in array
this code will remove doubles, but it shows a good example of using the join methode to empty the array
Code:
Private Function FindDuplicate(a)
For i = 0 To UBound(a)
For j = i + 1 To UBound(a)
If a(i) = a(j) Then
a(i) = ""
End If
Next j
Next i
strtemp = Join(a, ",")
Do While InStr(1, strtemp, ",,")
strtemp = Replace(strtemp, ",,", ",")
Loop
If Left(strtemp, 1) = "," Then strtemp = Mid(strtemp, 2, Len(strtemp) - 1)
If Right(strtemp, 1) = "," Then strtemp = Mid(strtemp, 1, Len(strtemp) - 1)
b = Split(strtemp, ",")
End Function
__________________
Mark
If you found a post particularly helpful, show your appreciation by clicking the "scales" icon in the bar just above the post, at the right hand side.
Last edited by MARKEDAGAIN : November 26th, 2005 at 11:55 AM.