Visual Basic 6 Tutorial => Do Loop

Download Visual Basic 6 (PDF)

Visual Basic 6

  • Getting started with Visual Basic 6
  • Basic Syntax
    • Do Loop
    • for loop
    • if / else statement
    • Select Case Statement
  • Function Procedures
  • Installing VB6 on Windows 10
  • Variables

Visual Basic 6

  • Getting started with Visual Basic 6
  • Basic Syntax
    • Do Loop
    • for loop
    • if / else statement
    • Select Case Statement
  • Function Procedures
  • Installing VB6 on Windows 10
  • Variables
Visual Basic 6 Basic Syntax Do Loop

Fastest Entity Framework Extensions

Bulk Insert Bulk Delete Bulk Update Bulk Merge

Example

Another common type of loop in Visual Basic is the DO loop, which would run a piece of code continuously until it is told to stop. On the contrary of some other loops whereby indexes are used to stop the process, in this particular loop, it should be told to stop.

A simple example illustrating the loop is as follows

Dim iIndex1 As Integer iIndex1 = 1 Do Debug.Print iIndex1 iIndex1 = iIndex1 + 1 If iIndex1 = 10 Then Exit Do End If Loop

The above piece of code will take an Index, initialized to 1, and increment it. A Debug.Print will help print the index to rack the loop. On each loop, the code will verify if the index has reached 10 and if and only if the condition is true, the Exit Do will be executed, which will stop the loop.

Got any Visual Basic 6 Question?

Ask any Visual Basic 6 Questions and Get Instant Answers from ChatGPT AI: ChatGPT answer me! pdf PDF - Download Visual Basic 6 for free Previous Next This modified text is an extract of the original Stack Overflow Documentation created by following contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow logo rip SUPPORT & PARTNERS
  • Advertise with us
  • Contact us
  • Cookie Policy
  • Privacy Policy
STAY CONNECTED

Get monthly updates about new articles, cheatsheets, and tricks.

Subscribe Cookie This website stores cookies on your computer. We use cookies to enhance your experience on our website and deliver personalized content. For more details on our cookie usage, please review our Cookie Policy and Privacy Policy Accept all Cookies Leave this website

Từ khóa » Visual Basic 6.0 While Loop Example