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

Variable scope, Variables must always be described with the smallest scope ...

Variables must always be described with the smallest scope possible. VBScript variables can have the given scope. Scope Where Variable is Declared

Runtime proggramming, i have a database i want mange it network and i want ...

i have a database i want mange it network and i want write it with vb.net so how i can do this

Program for computing automobile repair bills, A program is needed to assis...

A program is needed to assist computing automobile repair bills. The cost of labor is $35 per hour. The costs for parts are subject to a 5% sales tax, which should be added t

Device context - visual c++, DEVICE CONTEXT The device context provides...

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

#simple interest using pseudocode and flowcharts, simple interest using flo...

simple interest using flowchart and psuedocode using the formular s= x + nrx

Programming, steps of connecting database from vb6.0

steps of connecting database from vb6.0

Match Game, I would like someone to look at my code and tell me why it''s n...

I would like someone to look at my code and tell me why it''s not working

Dictionary, how to make dictionary in vb using ms access

how to make dictionary in vb using ms access

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