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 |
Differenece betwen Project and product ? when company need project or product?
Tell me the QTP Advantages and Disadvatages ?
Through array we can execute the testcase how ? give me example
How can we use regular expressions for a table in web page, each cell in table having unique identification, Now I want to count number of rows in table and enter data in all cells of the table?
What is accessibility check point?
What is the use of text output value in quicktest professional (qtp)?
While spliting an action in QTP 10.0 getting an error : "This Line is a part of Script Block.You cannot split the action on this line." how to re-solve this and split the script into actions?
What is the syntax to call one script from another?
what is run-time object property in Object spy in QTP9?
Hi I able to record IE object but not able to record mozilla firefox 3 object using QTP 10. i don know wats the problem????
how we do database testing with qtp using descriptive programming?
22 Answers Nutrins, Rohit Technologies, Symphony, Syntel, TCS,
Is it a smart choice to use QTP for backend testing?