Micro Focus QTP (UFT) Forums

Full Version: Confused in dot net arraylist
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi to All,

Today I am struck in below problem.I have a scenario similar to below as given ,I have to add number in dotnet arraylist and then sort it . When I execute the below code,it does not show me the desired result.Could anybody help me in this regard?

' **************Below is my code***********
Code:
Set Mylist=DotnetFactory.CreateInstance("System.Collections.ArrayList")

MyList.add("110714")
MyList.add("110790")
MyList.add("110914")
MyList.add("110915")
MyList.add("110933")
MyList.add("14403")
MyList.add("14618")
MyList.add("14619")
MyList.add("14620")
MyList.add("14925")
MyList.add("245534")
Mylist.sort



For q=0 To Mylist.count -1
print Mylist.item(cint(q))
Next

'********************************

'****Actual result is coming************
110714
110790
110914
110915
110933
14403
14618
14619
14620
14925
245534
'**********************************


'**************My expected result***********
14403
14618
14619
14620
14925
110714
110790
110914
110915
110933
245534
'***********************************
Any reply on above thread?