Skip to main content This browser is no longer supported. Show
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Do...Loop Statement (Visual Basic)
In this articleRepeats a
block of statements while a Syntax
Parts
RemarksUse a You can use either You can test The condition usually results from a comparison of two values, but it can be any expression that evaluates to a Boolean Data Type value ( You can nest Note The Exit DoThe
Exit Do statement can provide an alternative way to exit a
You can include any number of When used within nested Example 1In the following example, the statements in the loop continue to run until the
Example 2The following example uses a
Example 3In the following example,
Example 4The following example reads all lines in a text file. The OpenText method opens the file and returns a
StreamReader that reads the characters. In the
See also
FeedbackSubmit and view feedback for Which structure is a structure that causes a statement or a set of statements to execute repeatedly?A Loop is a control structure that causes a statement or group of statements to be executed repeatedly. Frequently in a program you will want to repeat an action several times or until some condition is met. We do this in a loop.
What is a structure that allows the computer to make a decision between alternative conditions?A decision structure is a construct in a computer program that allows the program to make a decision and change its behavior based on that decision. The decision is made based on the outcome of a logical test.
Which structure determines the order in which a set of statements executes?A control structure is a logical design that controls the order in which a set of statements execute.
What is meant by the term conditionally executed?Conditional execution controls whether or not the core will execute an instruction. Most instructions have a condition attribute that determines if the core will execute it based on the setting of the condition flags.
|