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.
Work with the console class - Visual Basic Tutorial
From the course: Visual Basic Essential Training
Work with the console class
- [Instructor] I've modified the code. I removed the hello world line, and I've added four extra lines of code or additional lines of code. We're working with the console class. We'll learn more about this as we go through the course, but I'm just using two methods, write line and read line. So write line is outputting this question, and then read line is waiting for the user to type some information and press enter. Once the user presses enter, then the information is placed in this variable. This is a string variable. Then on the next line, I write out a combination or a concatenation of those strings. So here's the first string. There's the variable, and there's the third string, question mark. And in VB, the ampersand is the concatenation operator. And then here on the last line, I'm calling console.readline again. Now notice this time I'm not storing the data that the user enters in any variable. What that means is the app will wait on this line of code until the user presses…
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
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-