May 2010
Intermediate to advanced
1272 pages
61h 18m
English
Methods execution typically completes when the End Sub or End Function statements are encountered. You often need to break methods execution before the execution completes. In the case of Sub methods, you can accomplish this using the Exit Sub statement. The following example checks the value of an integer and immediately breaks if the value is greater than 10. If not, it loops until the value is 10 and then breaks:

You can also use the Return keyword without a value instead of Exit Sub. For Function methods, things are a little different because they return a value. When the method execution completes regularly, you return a ...
Read now
Unlock full access