Download presentation
Presentation is loading. Please wait.
Published byDennis Daniel Modified over 8 years ago
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)
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.