''''''''''''''''Displaying numbers into Ascending Order By Using Arrays'''''''''''''''''''''''''''''''''''''''''
a=array(10,20,1,30,2,40,23,50,4)
For j=lbound(a) to ubound(a)
For i=lbound(a) to ubound(a)-1
If a(i)>a(i+1) Then
temp=a(i+1)
a(i+1)=a(i)
a(i)=temp
End If
Next
For i=lbound(a) to ubound(a)
x=x&chr(10)&a(i)
'y=a(i)&chr(10)
Next
msgbox(x)
Important Topics & Useful Scripts on QTP. Ask your QTP related questions at this id - asrajaputra@gmail.com
Showing posts with label arrays. Show all posts
Showing posts with label arrays. Show all posts
Saturday, December 6, 2008
Wednesday, December 3, 2008
Fixed VS Dynamic Arrays
'Using Fixed arrays
Dim x(2)
x(0)="how"
x(1)="are"
x(2)="you"
for i=lbound(x) to ubound (x)
msgbox x(i)
Next
'Here we cann't store more than 3 elements. Because this is a fixed length array..
'Using Dynamic Arrays
Dim x()
Redim preserve x(2)
x(0)="how"
x(1)="are"
x(2)="you"
Redim preserve x(3)
x(3)=123
'Here 'x' is a dynamic array and by redeclaring x it can able to store more values into it.
Dim x(2)
x(0)="how"
x(1)="are"
x(2)="you"
for i=lbound(x) to ubound (x)
msgbox x(i)
Next
'Here we cann't store more than 3 elements. Because this is a fixed length array..
'Using Dynamic Arrays
Dim x()
Redim preserve x(2)
x(0)="how"
x(1)="are"
x(2)="you"
Redim preserve x(3)
x(3)=123
'Here 'x' is a dynamic array and by redeclaring x it can able to store more values into it.
Subscribe to:
Posts (Atom)
About Me
- RAJAPUTRA
- Hi all,I am Arun Singh Rajaputra. I am working as a Project Lead in a reputed organization in Hyderabad, AP, India. I have little bit knowledge on Quick Test Professional and like to share my knowledge to all through this blog.
Subscribe to get updates on this blog
NOTE
Some of the posts posted in this blog are collected and most of them have been prepared by me. If any one have objections regarding any copied posts. Please mail me so that I can take a necessary action on that post.