Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to find Array Length in QTP?
#1
Solved: 11 Years, 4 Months, 3 Weeks ago Sad 
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
Reply
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
UBound(MyArray) returns the position of last array element, that is 5 in your example
Reply
#3
Solved: 11 Years, 4 Months, 3 Weeks ago
length_of_array = UBound +1 = 5+1= 6
Reply
#4
Solved: 11 Years, 4 Months, 3 Weeks ago
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP/UFT - Storing Multiple Arrays In An Array Eitel13 0 1,830 07-17-2018, 04:37 PM
Last Post: Eitel13
  Unable to use array in QTP amit25007 2 3,346 01-25-2016, 05:10 PM
Last Post: amit25007
  QTP:How to find an email with a subject line in MS outlook and then click on an link royrover 3 20,397 08-19-2010, 11:00 AM
Last Post: Arun Prakash
  Copying random length part of the string. unbeliever 5 4,969 01-07-2010, 02:55 PM
Last Post: unbeliever
  How to use Array of Array in QTP dineshb 1 16,656 12-12-2009, 02:00 AM
Last Post: rdemers25

Forum Jump:


Users browsing this thread: 1 Guest(s)