AndroidApacheAutomation FrameworkTechnical blogTrending

How to sort array values in qtp

Dim yourArray

Dim firstIteration

Dim secondIteration

Dim tempValue

yourArray=array(191,101,144,122,117,111,126,199,145,150,177,1,20202)

msgbox lbound(yourArray)

msgbox ubound(yourArray)

For firstIteration=lbound(yourArray) to ubound(yourArray)

       For secondIteration=lbound(yourArray) to ubound(yourArray)-1

                   If oArray(secondIteration)>yourArray(secondIteration+1) Then

                       tmp=oArray(oCounter2)

                       yourArray(secondIteration)=yourArray(secondIteration+1)

                       yourArray(secondIteration+1)=tempValue

                   End If

                      

       Next

    

Next

For firstIteration=lbound(yourArray) to ubound(yourArray)

   print yourArray(firstIteration)

Next

 

One thought on “How to sort array values in qtp

Comments are closed.