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.
Declare a variable - Visual Basic Tutorial
From the course: Visual Basic Essential Training
Declare a variable
- [Instructor] In this video, we're looking at how to declare variables of the common numeric types like integer and double. Think of this as the real application of the principles we covered in the slides earlier in this chapter. So I'm in this project Declare and I've made that the startup project. To be clear, the code in this video pertains to local variables, meaning a variable declared within a method body. We'll discuss class and module level variables later. Let's start by opening up the XML file and then double clicking on this button to see the code behind. So we're looking at how to declare a local variable. The four parts are the Dim keyword. That's the declaration start. The identifier or what we would call the name specifying the type in VB. That's what the as keyword as integer. And then here we're assigning a value of 22. An initial value. Here we're specifying as double. In this section we're working with declaring it without specifying the type. Here I'm saying Dim…
Contents
-
-
-
-
-
-
-
-
(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)
-
-
-
-
-
-
-
-
-
-
-
-