Changes

Jump to: navigation, search

Visual Basic Do ... Loops

643 bytes added, 19:19, 6 August 2007
New page: Often when looping it is not possible to know in advance how many times the loop needs to be performed. For example, a loop may need to continue until some specific criteria are met. Under...
Often when looping it is not possible to know in advance how many times the loop needs to be performed. For example, a loop may need to continue until some specific criteria are met. Under such circumstances the Visual Basic ''Do ... Loop'' structure is used.

== Creating a Visual Basic Do ... Loop ==

The Visual Basic ''Do ... Loop'' structure can be used in a variety of different ways. The first, basic method involves a simple Do loop with an Exit statement called based on a ''If'' statement. The syntax for this type of Do Loop is as follows:

'''Do'''
''[VB Statements]''
'''If''' ''expression'' '''Then Exit Do'''
'''Loop'''

Navigation menu