On Thursday, February 23, 2012 5:45:18 PM 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).
here is simple way to do it..... Dim NewArr() arrList = array(4,4,4,4,10,10,20,45,10) j=0 compVal=arrList(0) Redim NewArr(0) NewArr(0)=arrList(0) For i=1 to ubound(arrList)-1 If compval<>arrList(i) then j=j+1 Redim preserve NewArr(j) NewArr(j)=arrList(i) compval=arrList(i) End if Next msgbox "New array is"& JOin(NewArr,",") -- -- 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.
