we can remove duplicate values from an array in QTP by using filter 
function:

duplicateArray=array("1","2","3","1","1","5","3","6","4","4","5","7","9","0","0")

j=0
For i=0 to ubound(duplicateArray)
ReDim Preserve uniqueArray(j)
uniqueArray(j)=duplicateArray(i)
If ubound(filter(uniqueArray,duplicateArray(i)))=0 Then
        j=j+1
Else
ReDim Preserve uniqueArray(j-1)
 End If
    
Next

msgbox join(uniqueArray)



On Thursday, 23 February 2012 17:45:18 UTC+5:30, tariful islam wrote:
>
> Hi all, 
> how to remove duplicate values from an array and store the result in a 
> new array....suppose my array is alist(4,4,4,4,10,10,20,45,10) 
> i want to store in a new array=(4,10,20,45).

-- 
-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

--- 
You received this message because you are subscribed to the Google Groups "QTP 
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to