Presentation is loading. Please wait.

Presentation is loading. Please wait.

VB.NET 2008 Introduction to Variables Part 1. Overview.NET Languages –Source Code –Compiler –MSIL –CLR & Windows Variables –Data Types –Converting.

Similar presentations


Presentation on theme: "VB.NET 2008 Introduction to Variables Part 1. Overview.NET Languages –Source Code –Compiler –MSIL –CLR & Windows Variables –Data Types –Converting."— Presentation transcript:

1 VB.NET 2008 Introduction to Variables Part 1

2 Overview.NET Languages –Source Code –Compiler –MSIL –CLR & Windows Variables –Data Types –Converting

3 Variables Standard Variable types –Integer –String –Decimal –Single Precision –Double Precision –Date –Boolean (True/False) Declaring –Must dimension all variables (Set aside RAM)

4 Declaring Variables Explicitly declare your variable types –Examples: Dim lastName As String Dim weight As Double Think of Dim as “Dimension” or “create space” in RAM to hold the number of bytes you need. Use “Option Explicit” at the start of all your projects from now on! This will force you to declare variables and will catch spelling errors too.

5 Declaring Variables Multiple variables in one Dim –Dim lastName, firstName, middleName As String Dim & assignment combined –Dim lastName As String = “Smith” Combine –Dim customerAge As Integer = 21, firstName As String = “Joe”

6 Explicit Conversions 1.VB.NET “c” functions“c” functions 2..NET Convert classConvert class –Example: Convert.ToString(age) –Here I use both ways as an example: lblBalDue.Text = Convert.ToDecimal(txtPrice.Text) + CDec(lblTax.Text)


Download ppt "VB.NET 2008 Introduction to Variables Part 1. Overview.NET Languages –Source Code –Compiler –MSIL –CLR & Windows Variables –Data Types –Converting."

Similar presentations


Ads by Google