From the course: Visual Basic Essential Training
Unlock this course with a free trial
Join today to access over 24,500 courses taught by industry experts.
Use Do loops to run code until a condition is fulfilled - Visual Basic Tutorial
From the course: Visual Basic Essential Training
Use Do loops to run code until a condition is fulfilled
- [Instructor] The do loop is used when a loop must run continuously until a specific condition is satisfied. Then the loop ends. We've seen the do loop earlier in the course when I created a console application that ran endlessly until the correct key was entered on the keyboard. There are four variations of the do loop, which I'm demonstrating here in the endless loop method. All the variations start with the word do here on line 21 and end with the word loop. We then write a test condition to control when the loop ends. The test condition can be placed either at the end of the loop as shown here in these first two examples, or at the beginning of the loop like you see here on line 31 and on line 36. So the way this would work is it's going to start here. It'll run all the code in this section of the do loop and then when it gets to here, it's going to check this condition. It's going to loop while this condition is true. So if this is true and the expression here is true, then…
Download courses and learn on the go
Watch courses on your mobile device without an internet connection. Download courses using your iOS or Android LinkedIn Learning app.
Contents
-
-
Chapter roadmap4m 33s
-
(Locked)
Set up the tools1m 45s
-
(Locked)
Create a console app1m 46s
-
(Locked)
What files are in the new project2m 23s
-
(Locked)
Build and compile the application2m 10s
-
(Locked)
Run the application4m 49s
-
(Locked)
Work with the console class2m 1s
-
(Locked)
The forgiving nature of VB code2m 2s
-
-
-
(Locked)
Optimize the Visual Studio settings1m 55s
-
(Locked)
Create a console project in Visual Studio4m 2s
-
(Locked)
Projects and solutions2m 5s
-
(Locked)
Examine the template structure and code1m 45s
-
(Locked)
How the editor enhances our code3m
-
Use the auto suggestions when editing5m 21s
-
(Locked)
Compile the project code2m 9s
-
(Locked)
Run the example code from Visual Studio2m 28s
-
(Locked)
Run the example code with a debugger2m 23s
-
(Locked)
-
-
(Locked)
Understand default code flow for an application6m 49s
-
(Locked)
Event driven code3m 21s
-
(Locked)
Create a program loop to run an application indefinitely4m 52s
-
(Locked)
Listen for KeyChar to terminate the loop3m 9s
-
(Locked)
The To-Do application1m 18s
-
Work with a Windows UI project4m 49s
-
(Locked)
Add click event handler code3m 29s
-
(Locked)
Add TextChanged event handler code2m 30s
-
(Locked)
-
-
(Locked)
Work with variables and constants8m 17s
-
(Locked)
Use the code explorer project3m 26s
-
(Locked)
Declare a variable5m 35s
-
(Locked)
Variables and .NET types3m 36s
-
(Locked)
Naming your variables2m 19s
-
(Locked)
Understand the variable scope: What code can access the variable4m 19s
-
How data conversion works7m 49s
-
(Locked)
Convert numeric values5m 35s
-
(Locked)
Create custom constants1m 29s
-
(Locked)
Work with built-in constants3m 36s
-
(Locked)
Work with enum values3m 45s
-
(Locked)
Create a custom enum1m 35s
-
(Locked)
-
-
(Locked)
Understanding strings6m 41s
-
(Locked)
Create string variables4m
-
(Locked)
Concatenation and interpolation2m 56s
-
(Locked)
Search string contents2m 59s
-
(Locked)
Modify string contents3m 3s
-
(Locked)
String creation with StringBuilder5m 39s
-
(Locked)
Compare and equals5m 51s
-
(Locked)
Convert and format numbers to strings8m 4s
-
(Locked)
Implicit covert strings to numbers2m 50s
-
(Locked)
Use Parse and TryParse conversions5m 4s
-
(Locked)
-
-
(Locked)
The date types2m 27s
-
(Locked)
Define date and time variables1m 6s
-
(Locked)
Initialize date and time values4m 42s
-
(Locked)
Output formatted date values3m 50s
-
(Locked)
Date manipulation2m 14s
-
(Locked)
Challenge: Strings, dates, and parsing1m 47s
-
(Locked)
Solution: Strings, dates, and parsing2m 22s
-
(Locked)
-
-
(Locked)
The Code Explorer updated UI58s
-
(Locked)
If and else statements5m 44s
-
(Locked)
Use the AndAlso and OrElse logical operators4m 12s
-
(Locked)
Select case: A better way to branch5m 1s
-
(Locked)
Challenge: Logic statements and string compare2m 5s
-
(Locked)
Solution: Logic statements and string compare2m 51s
-
(Locked)
-
-
(Locked)
Explore the collection classes10m 18s
-
(Locked)
Use a ListBox instead of a text control3m 10s
-
(Locked)
Create new collections6m 30s
-
(Locked)
Initialize a collection2m 23s
-
(Locked)
Add items to a list1m 13s
-
(Locked)
Get items from the list3m 16s
-
(Locked)
Remove items from a list1m 15s
-
(Locked)
Iterate over a list5m 20s
-
(Locked)
Bind a list to a user control5m 46s
-
(Locked)
Delegates and lambda expressions4m 36s
-
(Locked)
Customize a method with predicate functions5m 21s
-
(Locked)
Quick look at other collection classes4m 28s
-
(Locked)