Ubound stands for upper bound. This functions is used to find the upper bound of the array.
Syntax -
ubound(arrayname, dimension)
It returns the upper bound of the arrayname and dimension used is specified in second parameter.
By default dimension is 1.
Example -
Single dimension array
Dim a(2)
'Declare an array with upper bound (index) as 2.
a(0) = 0
a(1) = 0
a(2) = 0
print ubound (a) 'will print 2
print ubound (a,1) 'will print 2
'This will print the value 2 as upper bound of the array is 2.
Please note that size or length of the single dimension array is ubound + 1.
Multi dimension array
Dim b(2,3,5)
print UBound(b, 1) ' will print 2
print UBound(b, 2) ' will print 3
print UBound(b, 3) ' will print 5
More interview questions and answers on arrays in QTP are given below.
Please give your inputs, suggestions, feedback to Us. We value your thoughts.
Syntax -
ubound(arrayname, dimension)
It returns the upper bound of the arrayname and dimension used is specified in second parameter.
By default dimension is 1.
Example -
Single dimension array
Dim a(2)
'Declare an array with upper bound (index) as 2.
a(0) = 0
a(1) = 0
a(2) = 0
print ubound (a) 'will print 2
print ubound (a,1) 'will print 2
'This will print the value 2 as upper bound of the array is 2.
Please note that size or length of the single dimension array is ubound + 1.
Multi dimension array
Dim b(2,3,5)
print UBound(b, 1) ' will print 2
print UBound(b, 2) ' will print 3
print UBound(b, 3) ' will print 5
More interview questions and answers on arrays in QTP are given below.
- What is the difference between dictionary and array in QTP?
- How to create dynamic 2 dimensional array in QTP?
- How to sort array of strings in qtp?
- How to create array of dictionary in qtp?
- How to define or declare array in qtp?
- How to return array from function in qtp?
- How to find the length of array in qtp?
- How to find the size of array in qtp?
- Explain the ubound function in qtp.
- Explain the split function in qtp with example.
- What is dotnetfactory object in qtp?
Please give your inputs, suggestions, feedback to Us. We value your thoughts.
No comments:
Post a Comment
Please Leave your reply. We value your feedback and inputs