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

Explain the differences between table and db checkpoints?

668


Explain in brief about the qtp automation object model (aom).

642


if our qtp vb Script may be Currepted then What we want do?

1580


In the application that I'm testing is having a WYSIWIYG editor.QTP is recording editor's body as web element. I want to add some data to this web Element at run time. The problem is that I cant find a method to add contents to this web Element. Can any one come up with an answer for this. Thankx.

1539


Dear All , For UFT 12.02 which version QC or ALM will support ? Thanks Balaji

1024






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

1576


Tell me one scenario, the complex functionality you have automated in your project?

1571


What is the virtual object?

748


How you are developing the script? Using record and play back or manual?

703


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

1451


Hello friends..... On which areas of an application we can not test with QTP

1670


How many types of recording modes are there?

673


hi can anybody help with an qtp 9.2 license key please. Thanks, Nitesh.

1965


What are the steps involved in the recovery scenario wizard?

645


Explain object spy in qtp.

692