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 |
What is the extension of QTP local Repository? If it is .mtr then what is .bdb extension stands for?
how to capture the run time values of web table.
I am a newbie to QTP / Automation testing. I want to develop a script that creates a data file automatically with proper headings using VBScript in QTP.
How to do the Mouse Operations in QTP. How to aacess an Image in a web application to save it on my desktop. To my Knwoledge that can be done by mouse right click on the Image and selecting 'Save the Image'option. Or Is there any alternate way to do this..
please tellme ordernal identifiers in QTP?
How we can test a Frame in a web page?
what is mean by output parameters? I need full description with example. tell me any one please
How to check bitmap output value?
What does VBS file contain..? what is VBS file.?
how to identify the user defind varibles? plz tell me
how to load vbs file to qtp through scripting. plz provide the code.....
Hi Friendss..., can any body help me.. 1. Tell me your achievements(Technically)..? 2. Tell me your strengths(Technically) and weakness(Technical)..? 3. Why are you looking for change..?