VB.NET Do Until Loops - Dot Net Perls
Có thể bạn quan tâm
All loops in VB.NET have a similar purpose. They cause a block of statements to repeat a certain number of times. The Do Until loop is similar to the Do While loop.
Do Until uses a slightly different syntax than Do While. In this loop, the Until condition causes termination when it evaluates to True.
This program uses both a Do Until loop and a Do While loop. The Do Until loop has the condition "i = 10". This loop will continue repeating until the variable "i" is equal to ten.
Warning This syntax can easily result in an infinite loop if you are not careful.And We find that Do Until has all the same problems as While and Do While in this respect.Syntax
This syntax may be more readable if the terminating condition for the loop is the most intuitive. It really just depends on what you prefer.
Note The Do While syntax is more expected for developers used to C# or C-like languages.Info The Do Until syntax could be thought of as a "Do While Not" syntax. It changes a Do While loop to evaluate while False.Iteration
Iteration variables in the Do Until loop must be incremented with a separate statement. If you have an iteration variable (such as i) it is probably better to use a For-loop.
And If you looping over elements of a collection, it is probably best to use a For-Each loop.Do Until may provide a clearer syntax for loops in some programs. For developers of languages based on C, though, the syntax may be less intuitive and worth avoiding.
Từ khóa » Visual Basic Do Until
-
Do...Loop Statement - Visual Basic - Microsoft Docs
-
Vòng Lặp Do-Until Trong VBA - VietTuts
-
VBA - Do-Until Loops - Tutorialspoint
-
Thực Hành Với Visual Basic: Cấu Trúc Lặp Do ... Loop While
-
While Loop, Do While Loop, Do Until Loop, While End While - VB.NET
-
Hướng Dẫn Cách Viết Vòng Lặp Do Loop Trong VBA - Học Excel Online
-
Visual Basic Do ... Loops
-
Visual Basic Tutorial - 30 - Do Until Loop - YouTube
-
Visual Basic (VB) Do While Loop - Tutlane
-
Visual Basic Do Loops | The Coding Guys
-
Guide: Do Until Loops In VBA - Software Solutions Online
-
Do Until Loop Excel VBA
-
Loops (Repetition Structures) In Visual Basic 6
-
Do Until Loop In Excel VBA (In Easy Steps)