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 |
Inserting a Call to Action is not importing all columns in Datatable of globalsheet. Why?
RECENTLY I PLACED IN QTP..HOW TO IMPROVE VB SCRIPTS KNOWLEDGE? IAM STRUGGING TO WRITE THE AUTOMATION SCRIPTS? ANY BODY TELL HOW TO IMPROVE QTP SCRIPT SKILLS?
What is qtpro? What is a quick test professional?
Hello, I am learning QTP. I have recorded test for Login page, i have also inserted checkpoint for Email field & when I run test it passed. But when i tried to run test by inserting 'Adding Parameter Values to a Data Table' for email & password field, it pass the first value in both the fields but after that when test run for second parameter values it displays 'Internet Explorer cannot open the Internet site, Operation aborted' & when i analyze test result it displays run time error 'Object disable'. I have also cleared all the history from IE but it is not working. Please help me. Thank you.
Is it possible to return multiple values from a function..? Then how..?
Does QTP supports Linux or Unix OS?.If so which scripting is preferable? Shell we do record and playback
Can we call a parameter from an action to other action?
four browser are open same application i want to enter 3browser how?
what is the mediater between qtp and application/project in automation testing?
What are table and db checkpoints?
tell me exact differenceb bw qtp and selenium?(could not tell open soure and licennce? difference in usage and technical difference?
Could you please any one give code for the following ? Scenario : Suppose a excel file contains 10 records and earch have 5 fields. how can i input this excel file for datadrive wizard ? Please explain