VB 6 While Loop - Notesformsc
Có thể bạn quan tâm
- Home
- Computer Science
- Programming
- Mathematics
- Solved Examples
- Home
- Uncategorized
- VB 6 While Loop
Like many programming languages out there, VB 6 also has loop control statements. In this article, you will learn about While loop which helps in repeating a block of code until loop is terminated.
Syntax: While Loop
The general structure of while loop is given below.
While condition [expression or statements] WendThe condition is very important in while loop because that is what decides when the loop will be terminated.
Consider the example below.
Dim index As Integer index = -1; While index < 10 MsgBox (index + 2) WendIn the example above, we have put a condition for while loop that the loop should continue until index variable is equal to or greater than 10.
Example Program:
Dim Sum As Integer, i As Integer i = 0; While i < 10 Sum = Sum + i i = i + i Wend MsgBox ("The Value of Sum is " + Sum)Output – While Loop
The program loop through and add the value of i to Sum which is incremented by 1 at each iteration.

Advertisements
Go to mobile versionTừ khóa » Visual Basic 6.0 While Loop Example
-
Loops (Repetition Structures) In Visual Basic 6
-
While...End While Statement - Visual Basic - Microsoft Docs
-
Do While Loop In Vb6.0 - CodeProject
-
Using Visual Basic 6 -- Ch 10 -- Working With Loops
-
Visual Basic (VB) Do While Loop - Tutlane
-
Visual Basic While Loop - Tutlane
-
[PDF] Existing Loop 1. Do While Condition Loop
-
Lesson 9 : Looping - Visual Basic Tutorial
-
While Loop, Do While Loop, Do Until Loop, While End While - VB.NET
-
While Loop With Example In Visual Basic 6.0 - YouTube
-
VB 6.0 Example 4 (do While...Loop) - YouTube
-
Looping Control Statements In VB 6.0 | Do While Loop - YouTube
-
Visual Basic 6 Tutorial => Do Loop
-
Visual Basic/Loops - Wikibooks, Open Books For An Open World