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

Assignment Help:

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


Related Discussions:- Repeating a statement until a condition becomes true

Loop statement from inside the loop, You can exit a Do...Loop using the Exi...

You can exit a Do...Loop using the Exit Do statement. Since usually you desire to exit only in certain situations, such as to ignore an endless loop, you should employ the Exit Do

Programming project using straight-line method, Depreciation to a Salvage V...

Depreciation to a Salvage Value of 0.   For tax purposes an item may be depreciated over a period of several years, n. With the straight-line method of depreciation, each year th

Data types - visual basic, DATA TYPES   The different primitive data t...

DATA TYPES   The different primitive data types are Boolean, Char, Byte, Date, Decimal, Uinteger, Double, Integer, Long, Sbyte, Short, Single, String, Ulong & Ushort. To decla

Module - dialog box in visual basic, MODULE The Modules are the collect...

MODULE The Modules are the collection of VB statements. Modules are used to simplify the program development. To add a module to your project, choose the project tabpage, and t

Storage and retrieval systems, STORAGE AND RETRIEVAL SYSTEMS   The sto...

STORAGE AND RETRIEVAL SYSTEMS   The storage system is a depository. It is a physical container and gives mechanisms to put in the depository and take them back. The retrieval

Validation controls, Describe different validation controls of VB.net?

Describe different validation controls of VB.net?

Web Scraping via program, I''m trying to create a program in VB.net that wi...

I''m trying to create a program in VB.net that will basically load the page within itself and allow you to input data via the program rather than going to the actual site using you

Programming, steps of connecting database from vb6.0

steps of connecting database from vb6.0

Project to create splitter window , PROJECT TO CREATE SPLITTER WINDOW   ...

PROJECT TO CREATE SPLITTER WINDOW   1. Generate the SDI application. 2. Enlarge the class tab page. 3. Select the view class. 4. On right clicking the menu pops up.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd