Exiting Property Procedures

In Chapter 4, you exited a procedure using the Exit Sub and Exit Function constructs. Similarly, you can exit a For..Next loop or Do..While loop, using the Exit For and Exit Do constructs respectively. When your property procedure has done what it was supposed to do, there is no need to continue executing any more code. You can use the Exit Property construct to immediately stop processing any more code and exit the property procedure.

As with other procedures, it is always better to have a single point of exit, so use Exit Property sparingly.

0 0

Post a comment