Do while loop statement, Visual Basic Programming

Do While Loop Statement:

The statements contained by the do...while loop block executes till the condition given in the while is true.

The working of do...loop is elaborated with the event Form_MouseDown which is shown in the figure. Whenever you click the mouse on the form, then the event handler executes and generates the output as given in figure as shown.

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y

As Single)

Dim i As Integer

i = 5

Do While i > 0

Form1.Print "i is " & i

i = i - 1

Loop

End Sub

1236_do while loop statement.png

Figure: Working of do while loop

Posted Date: 10/9/2012 8:52:50 AM | Location : United States







Related Discussions:- Do while loop statement, Assignment Help, Ask Question on Do while loop statement, Get Answer, Expert's Help, Do while loop statement Discussions

Write discussion on Do while loop statement
Your posts are moderated
Related Questions
For reason of readability & consistency, employ the following prefixes along with descriptive names for variables in your VBScript code. S ub type Prefi

Variable Length Strings: The Strings can be declared using As or $ as shown in the code below; the msg and msg1 are the two strings and they are assigned the values using '='.

MENUS AND TOOL BARS   The Menu options can be checked, enabled, disabled, and popped up on an object. The Menu Object: The Menu control is used to generate a menu in


The body of variable or procedure name must use mixed case and complete as essential to define its purpose. Additionally, procedure names must begin with a verb, such as CloseDialo

Device Contexts: The Device Context (DC) is represented by the data type Handle to Device Context (HDC). The HDC is a handle to somewhat you can draw on; it can be the whole s

You can employ the SCRIPT element to add VBScript code to an HTML page. The SCRIPT Tag VBScript code is written inside paired SCRIPT tags. For instance, a process to test

Fixed length strings: The Fixed length strings are declared by identifying the size of the string. For illustration to give a length of 20 for the string place, the declarati

I have a project due tomorrow that I am really struggling in. Please help.

CONTROL STATEMENTS   The conditional expression uses a comparison operator that results in true or false value. If the comparison is valid the outcome is true, or else the out