Summary

In this hour we looked at Visual Basic .NET's control structures. Control structures alter the program flow from a sequential, one line after the other model, to one where lines of code can be conditionally executed and can be executed repeatedly until some specified set of criteria is met.

VB.NET supports conditional control structures through the If statement. The If statement evaluates a condition and, if it is True, executes the instructions following the Then. In addition to the If ... Then portion of an If statement, ElseIf and Else clauses can be included.

Visual Basic .NET has a number of looping constructs, the two most common ones being the For loop and the Do loop. The For loop works with an integer variable that it assigns ...

Get SAMS Teach Yourself ASP.NET in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.