Repeating a statement until a condition becomes true, Visual Basic Programming

You can employ until keyword in two ways to verify a condition in a Do...Loop statement. You can verify the condition before you enter the loop (as illustrated in the following ChkFirstUntil instance), or you can verified it after the loop has run at least once (as illustrated in the ChkLastUntil instance). As long as the condition is False, the loop will be continues.

Sub ChkFirstUntil()

Dim counter, myNum counter = 0

myNum = 20

Do Until myNum = 10 myNum = myNum - 1 counter = counter + 1

Loop

MsgBox "The loop made" & counter & "repetitions." End Sub

Sub ChkLastUntil()

Dim counter, myNum counter = 0

myNum = 1

Do

myNum = myNum + 1 counter = counter + 1

Loop Until myNum = 10

MsgBox "The loop made " & counter & " repetitions." End Sub

Posted Date: 4/18/2013 5:50:48 AM | Location : United States







Related Discussions:- Repeating a statement until a condition becomes true, Assignment Help, Ask Question on Repeating a statement until a condition becomes true, Get Answer, Expert's Help, Repeating a statement until a condition becomes true Discussions

Write discussion on Repeating a statement until a condition becomes true
Your posts are moderated
Related Questions
Describe different validation controls of VB.net?

I have an assignment In HCI , can anyone help me ?

INTRODUCTION TO CONTROLS AND TOOLBARS The Visual Basic programming is an event driven programming. In the form objects the termed controls are placed. We can put the properties

'This program compares interest rates between two banks and determines the best bank PublicClassForm1 PrivateSub Button1_Click(sender AsSystem.Object, e AsSystem.EventArgs) H


Assume you are creating an order entry and editing application for a book store. An order consists of a product, quantity, total price, payment type including Credit/Debit card acc

INTRODUCTION to VISUAL C++ PROGRAMMING This section introduces you to develop the applications using VC++. The Single document interface (SDI), multiple document interface (MDI

Displaying the file Without Scrolling: To display a file follow the steps as shown below: 1. Generate a SDI application. 2. Type the coding as shown in the Serialize els

Case: Design a web page that contains the VBScript utilized for calculating subtotals, taxes, discounts & totals as well as code utilized to validate use

I am having a hard time with calculating APY in my project. Every time I run the program my second APY is blank.