05 November 2017

Shorting Array value in decending order using UFT

 a = array(8,45,6,2,8,45,10,2,15,2,11)

Set obj = createobject("Scripting.Dictionary")
obj.CompareMode = vbtextcompare

For each val in a
    obj(val) = val
Next

a1 = obj.Items

For i = 0 To ubound(a1)
    For j = 0 To ubound(a1)
        If a1(i) < a1(j) Then
            t = a1(i)
            a1(i) = a1(j)
            a1(j) = t
        End If
    Next
Next

For k = 0 To ubound(a1)
    msgbox a1(k)
Next

No comments:

Post a Comment

AOM - Automation Object Model

'Creating QuicTest Object Set  qtapp =  createobject ( "QuickTest.Application" ) 'Launching the Application If  qtapp...