Posts: 2
Threads: 1
Joined: Jul 2008
Reputation:
0
07-22-2008, 02:28 PM
(This post was last modified: 07-22-2008, 02:30 PM by bhanu_bp7.)
How to find the length\size of an Array in QTP?
LineText="abcd efgh ijklm opqrst uvwx yz"
MyArray= split(LineText," ",-1,1)
Length ??????
Please help me
Posts: 85
Threads: 36
Joined: May 2008
Reputation:
0
07-22-2008, 02:54 PM
UBound(MyArray) returns the position of last array element, that is 5 in your example
Posts: 1
Threads: 0
Joined: Jul 2008
Reputation:
0
07-23-2008, 01:47 AM
length_of_array = UBound +1 = 5+1= 6
Posts: 9
Threads: 2
Joined: May 2008
Reputation:
0
07-25-2008, 10:33 PM
You store all the variables in temp variabl
var1=Len(MyArray(0))
var2=Len(MyArray(1))
var3=Len(MyArray(2))
var4=Len(MyArray(3))
var5=Len(MyArray(4))
var6=Len(MyArray(5))
TotalVar=var1+var2+var3+var4+var5+var6
TotalArraySize = TotalVar
This is the pretty easier basic code to get the array value