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

Vbscript constants, A constant is a meaningful name which takes the place o...

A constant is a meaningful name which takes the place of a number or string and never alters. VBScript described a number of intrinsic constants. You can get thorough information r

Help context property, Sets or returns context ID for topic in Help File. I...

Sets or returns context ID for topic in Help File. If Help file is indicated in the VBScript Err Object HelpFile Property, the HelpContext property is utilized to display automatic

Imagelist, IMAGELIST The CImageList object is a collection of the same ...

IMAGELIST The CImageList object is a collection of the same sized images, all of which can be referred to by its index. The ImageList are used to proficiently manage the large

Application to count the number of possible triangles, A triangle is equila...

A triangle is equilateral if all three sides are equal, isosceles if any two (but no more than two) sides are equal, and scalene if no two sides are equal. A triangle will be input

Intrinsic controls, INTRINSIC CONTROLS   The Intrinsic controls are th...

INTRINSIC CONTROLS   The Intrinsic controls are the built-in controls. Few of the controls are Combo box, Check box, Command Button, Label etc. The controls have properties re

Create a calculator application, Create a VB calculator application that ap...

Create a VB calculator application that appears as in the screen shots below. The user enters numbers in the textboxes labelled Number 1 and Number 2. When a calculati

Check whether a number is palindrome or not, Function IsPalindrome(str) ...

Function IsPalindrome(str) Dim iStart,iEnd,ctr,blnPalin str=trim(str) blnPalin=true iEnd=len(str) iCnt=round(iEnd / 2) iStart=1 for ctr=1 to cint(iCnt) if(mid(str,iEnd,

Create vb to play a variation of hangman, Goal Create a Visual Basic th...

Goal Create a Visual Basic that allows a user to play a variation of Hangman. User Inputs • The user types a letter into the textbox. Functional Items 1. Read a series

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

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

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