Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get data from data table in Ascending order
#1
Not Solved
hi friends,
Suppose there is a sheet in data table of qtp with values like 5,9,1,7 or g,a,r,q,b how to sort them and display in Ascending Order using script
Reply
#2
Not Solved
Hi,

Try this code:

Code:
call SortArray()
Function SortArray()
'================================================
'Author:QTP Lab:a touch of madness!
'Date:23/11/2009
'Description:This function sorts an array into ascending
'            and descending order using .Net class methods.
'Function:SortArray()
'=========================================================
Dim myObj,MyArrAux
MyArrAux=""
Set myObj=CreateObject("System.Collections.ArrayList")
myObj.Add("Ba")
myObj.Add("R")
myObj.Add("A")
myObj.Add("Bb")
myObj.Add("S")
myObj.Add("M")
myObj.Add("D")
myObj.Add("J")
myObj.Add("Bc")
myObj.sort()

For each sNames in myObj
    MyArrAux=MyArrAux& sNames &":"
Next
msgbox MyArrAux,0,"Ascending order"

Set myObj=Nothing

End Function
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Multiple rows of test data Bhuvana 0 1,358 01-03-2020, 09:30 PM
Last Post: Bhuvana
  Set data parameters Mik2s 1 1,535 03-07-2019, 10:18 PM
Last Post: supputuri
  Excelsheet data entry Anshu 0 1,635 07-11-2017, 07:41 PM
Last Post: Anshu
  Want to read the data from excel and set read value in the JavaTable rajeevk7 0 2,355 07-10-2017, 04:20 PM
Last Post: rajeevk7
  dtLocalSheet empty even though excel file contains data cantorre 2 2,451 05-10-2017, 12:47 PM
Last Post: vidhi

Forum Jump:


Users browsing this thread: 1 Guest(s)