write vb script code to delete the duplicate values in an
array.

Answer Posted / saket bharti

aList=Array(5,5,5,5,12,10,15,10,125,5,1,1,2,3,4,5,6,7,8,8,8,8,8,8,8)

ReDim newArray(UBound(aList))

count=1

newArray(0)=aList(0)

for i=0 to UBound(aList)

temp=aList(i)

flag=0

for j=0 to UBound(newArray)

if ( newArray(j)=temp) Then

flag=1

End if

Next

if flag=0 then

newArray(count)=temp

count=count+1

End If

Next

ReDim Preserve newArray(count)


for j=0 to UBound(newArray)-1

msgbox newArray(j)

Next

Is This Answer Correct ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is Client side image is preferred over server side image?

1442


If we put all properties in mandatory and assistive list of Normal Identification, Do we still need Smart?

572


What is TOM in QTP?

1804


what is command for executing files?

1513


Difference between test object and run time object?

590






How do you open adobe acrobat file in QTP and do some testing on that file ?

621


what are the utilities and drivers

1845


can any boby tell me what is method or steps to connect the remote desk top by using QTP 9.2 version?

1621


write a script for allinterview-submit Question first we've to select Choose Category,second select Sub- Category(Which is comes in to runtime)third select Question Type.for that give some descriptive and vb script

1361


What if recovery scenarios is also failed for identify the alert ? (We are handling unexpected popup through recovery scenarios but if still recovery scenarios also failed than what should be the approach)

1010


what are the mandatory properties for a tex boxc (scenario?)

1528


In qtp, how you can remove the spaces from string?

546


what is keyword driven testing in qtp?n how is it useful?

1491


How to do the scripting. Is there any inbuilt functions in qtp as in qtp-s. What's the difference between them? How to handle script issues?

529


How you know that a test case is a regression test case

3058