Thursday, 21 July 2011

How To Exit from function or iteration? And continue with other function?

'Ex- For Exit funtion from iteration=5

Option Explicit
Dim i,a,
app()
open()
Function app()
For i=1 to 10
 a= "Test1" & i
SystemUtil.Run "iexplore.exe","www.google.com",,,3
Browser("Google").Page("Google").WebEdit("q").Set a
Browser("Google").Page("Google").WebButton("Google Search").Click
Browser("Google").Close
If i=5  Then
 Exit Function ' This Syntax is used for Quit this Function
End If
Next
End Function
Function open()
SystemUtil.Run "iexplore.exe","www.google.com",,,3
Browser("Google").Page("Google").WebEdit("q").Set "Velmuruganqa"
Browser("Google").Page("Google").WebButton("Google Search").Click
End Function

No comments:

Post a Comment