Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing Duplicates from VBScript Array

Status
Not open for further replies.

Deadline

Programmer
Feb 28, 2001
367
US
Hi,
Is there any convenient way to Eliminate duplicates from an array or a comma delimited string in VBSCript?

There was this easy way with VB where we forcefully add duplicates to a collection after setting
Code:
On Error Resume Next
. But how to do it in ASP/VBSCript ?

Desperate for solution... Thanks!

RR


 
It may not be the most efficient way of handling this, but it works...

Start a For..Next and set strAnyVariable equal to the first value. Check it against each value in the array via a new For..Next.

After the innermost, or second, For..Next has ended, move to the next value in the outermost For..Next and check it against all the values again (the innermost For..Next).

e.g.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top