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
MESSAGE LOOP   The message loop is the code in the Win 32 based application. It retrieves messages from the application's message queue and passes these to the related window

DEVICE CONTEXT The device context provides the essential drawing tools and the platform to draw. It helps to draw the text, shapes, lines etc. To create the device context, the

How to Include List Box control in your project A list box is used for representing the users with a data. You can prefer the data from the list box for data entry. No editing

Displaying The Database: The Text box, image box, check box, labels, picture box can be bounded to the data control for exhibiting the data base contents. The two properties a

MULTIPLE DOCUMENT INTERFACE (MDI) WINDOWS   The SDI (Single document interface) supports one open window or document at a particular time. Microsoft's notepad and paint are il

A variation on the If...Then...Else statement lets you to choose from various alternatives. By adding up Else If clauses expands the functionality of the If...Then...Else statement

I have a tiff image of 25 pages. I capture particular square from particular page and past on one excel sheet one by one. it is possible, if yes how. Image have line no and pe

Properties: Every control has a default property related with it. The default property does not require to be named when you are functioning. The control Check box as value

CLASS WIZARD The Class wizard shown in figure is a tool to handle the message handlers for objects, to define the member variables. Figure: Class Wizard

You can employ For...Next statements to run a block of statements a specific number of times. For loops, employ a counter variable whose value is increased or decreased with each r