Micro Focus QTP (UFT) Forums
exit from code - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: exit from code (/Thread-exit-from-code)



exit from code - stevol - 06-09-2008

Hi,
i don't understand how exit from code.. I have written an if-condition and i want exit from script if it is realized. On the main user guide I have found only something about exitaction, while in internet about "WScript.Quit", but it doesn't function because i have not defined any object WScript... and i wouldn't create it only to exit..
also something similar to "GoTo line x" would be right for me.
Any suggestion?

thanks a lot


RE: exit from code - somisays - 06-09-2008

Hi,
These are the predifined exit statements in QTP.

Exit Do
Exit For
Exit Function
Exit Property
Exit Sub
ExitAction
ExitActionIteration
Object.ExitCode
ExitTest
Exititeration


Depending on you criteria You can us the above things.May be you can use Exittest or exitaction or exititeration.

Regards
Sridhar


RE: exit from code - stevol - 06-10-2008

ExitTest is perfect :-)
thanks a lot