Ionsworld InfoTech Consult
Founded by the C.E.O. and Chief Logistics Officer, Iheanacho Nwaji Awama, a B.Eng and M.Eng holder of Electronics / Telecommunications engineering.
DATA DECLARATION
Before any data is used in programming as a storage medium, it must have its data type declared. This ensures that it continually stores and remits only that consistent data type to enable the program run optimally.
For example, if you have two buckets, one for storing and retrieving water for use and the other for storing kerosene, should the one for water is then added kerosene it ruins the content in that bucket and vice versa.
The data type is like the bucket that stores specified and uniform data. Once declared, it can conveniently handle that data within the limits of the declaration.
In visual Basic 2008 and upward, Dim is used as the data declaration code syntax
Data can be declared as:
1. numeric data types: eg Byte, Integer, Long, Single, Double, Currency, Decimal
2. non-numeric data types: eg String, Date, Boolean, Object, Variant (numeric or text)
Rules for declaring data:
1. Data must be less than 255 characters.
2. No spacing is allowed in data declaration.
3. Data type It must not begin with a number.
4. Period and some specific symbols (please find them out) are not permitted.
eg. My_bae and not My.bae, Thisboo not 2Thisboo, his_her_bucket not his&herbucket.
Therefore, declare data as Dim "Variable Name" As "Data Type"
ie. Dim password As String
Dim name As String
Dim counter As Integer
Dim average As Decimal
Dim askDate As Date
Assignment:
1. write a list of data names and the possible declaration type.
2. Elaborate the various data types and the range of data they can hold.
Try this:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Show()
Dim val As String
val = "my first code"
RichTextBox1.Text = val
If val = "" Then
Label1.Text = "welcome to visual basic tutorial with ionsworld infotech consult"
Else
Label1.Text = "welcome to visual basic tutorial with ionsworld infotech consult here is what you have typed: " + val
RichTextBox1.Hide()
End If
End Sub
End Class
Assignment: Run the code and try to alter the richtext box from the form dynamically.
13/09/2016
project!!! https://youtu.be/ARbLvbBTIJ4
Awesome Free Energy Technology That will Definitely Change the World Amazing Technology Inventions Free Energy Technology That will Definitely Change the World BFF Links: ✔ https://goo.gl/dtTwrX do you know? These Awesome Futu...
Click here to claim your Sponsored Listing.
Category
Contact the business
Website
Address
Harcourt
15/09/2017