Dim num, i, Length1
num=array(100,34,12,98,43,89,49,56)
Length1 = UBound(num) 'Find the length of array
For i= 1 to Length1
If (num(i)>num(0)) Then
num(0)=num(i)
End If
Next
MsgBox num(0)
Dim App ‘As Application
‘ Launch QTP
Set App = CreateObject(“QuickTest.Application”)
App.Launch
App.Visible = True
‘ Load an INI file with user-defined parameters
App.Test.Environment.LoadFromFile “C:\Test_Params\environment_file1.ini”
‘ Set the value of a specific user-defined Environment variable
App.Test.Environment.Value(“newvariable”) = “new value”
As you can see from the example, the Environment variable file is actually an .ini file. The structure would be:
[Environment]
var1=value1
var2=value2
On Error Resume Next statement enables the Error handling in the code.If there is error in the code "On error Resume Next" ignores it and continue with next line of code.
On Error Go to 0:
On error got to 0 statement disables error handling we have previiously enabled it by using On Error resume Next.