Write the vb script for the lowest and highest values of an
array?
Answer / pramod mallick
Dim x(5)
x(0) = 1
x(1) = 3
x(2) = 3
x(3) = 5
x(4) = 2
Dim y
Dim strArray
'Display
For y = LBound(x) To UBound(x)
strArray = strArray & x(y) & ","
Next
MsgBox "Before Sorting " & strArray
Dim z
'Demo loop
For z = LBound(x) To UBound(x)
For y = LBound(x) To UBound(x) - 1
Dim lower As Integer
Dim higher As Integer
If x(y) > x(y + 1) Then
higher = x(y)
lower = x(y + 1)
x(y) = lower
x(y + 1) = higher
ElseIf x(y) > x(y + 1) Then
higher = x(y)
lower = x(y + 1)
x(y) = lower
x(y + 1) = higher
Else 'equal
'do nothing
End If
Next
Next
'Display
strArray = ""
For y = LBound(x) To UBound(x)
strArray = strArray & x(y) & ","
Next
MsgBox "After sorting " & strArray
msgbox "Lowest is " & Lbound(x) & "Highest is " Ubound(x)
| Is This Answer Correct ? | 3 Yes | 1 No |
how to write xml output check point bu useing descriptive programing .means without useing output check point
What is the default object synchronization timeout in qtp?
am not having intrest in coding lang like c c++ java etc can i choose Testing tools as my carrier and please suggest me which tool is good (suitable for me)
why qtp supports vbscript? and not for others just like cgi,phython,shell,perl,html and all..
In an interview, what r the general questions asked in QTP? pls give me anwser to this question?
i have asked earlier only one question how to test web application using QTp plz send me the answer quickly
What do you to script when objects are removed from application?
How to open any application during Scripting in QTP?
What is object identification?
can u store QTp frame work folders in VSS? If Not where u store those?
Could any one suggest web site links to learning VB Script for QTP purpose??
How to face prjoect manager round what type of questions they will Ask ? (Chandana)
1 Answers Call Centre, Convergys, IBM,