Results 1 to 2 of 2

Thread: Tutorial on ...

  1. #1
    hackr is offline Member
    Join Date
    Apr 2017
    Posts
    3
    Rep Power
    0

    Default Tutorial on ...

    Loop, Do Until

    We have seen sequential and conditional execution of programs, and we will now look at looping, the repetitive execution of instructions. (In a subsequent note, we will cover a fourth flow mechanism called recursion in which a function calls itself).
    There are three loop statements in Visual Basic, For, Do while and Do until. This note discusses Do Until loops. The general form of a Do Until loop is:
    Learn Java online here Nothing to see here

    Do Until <boolean expression>

    body: statements to execute until
    the boolean expression becomes true

    Loop
    This inflexible loop program uses a Do Until loop:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    txtOut.Clear()
    Dim i As Integer
    i = 2
    Do Until i > 10
    txtOut.AppendText("loop" & " " & CStr(i) & vbCrLf)
    i = i + 2
    Loop
    End Sub
    The loop repeats as long as the Boolean expression is true. (In this case, that is while the variable i is less than or equal 10). Note that at least one of the statements in the body of the loop must change the value of the variables used in the Boolean expression if the loop is ever to terminate. (The statement i = i + 2 does that in this example).
    Last edited by Tolls; 04-20-2017 at 09:40 AM.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    25

    Default Re: loop program until "#'' is written.

    It's not a good sign, when trying to promote your site, to get something as basic as the programming language wrong.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. tutorial
    By pizzadude223 in forum New To Java
    Replies: 21
    Last Post: 08-02-2010, 09:45 AM
  2. JSF Tutorial
    By teststest in forum JavaServer Faces (JSF)
    Replies: 9
    Last Post: 11-15-2009, 05:31 AM
  3. tutorial
    By ayangupta in forum Threads and Synchronization
    Replies: 1
    Last Post: 03-01-2009, 06:38 PM
  4. Tutorial?
    By Gudradain in forum Java Software
    Replies: 24
    Last Post: 01-09-2009, 03:22 AM
  5. RCP tutorial
    By javaplus in forum Advanced Java
    Replies: 1
    Last Post: 12-25-2007, 04:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •