you have the try and catch blocks but no finally… the finally block can be very useful because it gets executed regardless of weather an exception is thrown. This will allow you to do clean up code with out puting it in two places.
Here’s an example of how code looks without the finally block:
try MoveTo "SomeButton" MouseButtonDown 1 WaitFor 2.0, "ButtonInDownState" MouseButtonUp 1 // release the mouse catch MouseButtonUp 1 // report the error etc... end try
Here’s the same example with the finally block implemented:
try MoveTo "SomeButton" MouseButtonDown 1 WaitFor 2.0, "ButtonInDownState catch // report the error etc... finally MouseButtonUp 1 // gets executed regardless of if the testcase fails end try