[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –
Visual Basic Tutorial – 47 – Coercion
by
Tags:
Comments
8 responses to “Visual Basic Tutorial – 47 – Coercion”
-
Using textbox!
Public Class Coercion
Private Sub btnCoercion_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCoercion.Click
Dim num1 As Integer = Nothing
Dim num2 As Double = Nothingnum1 = TextBox1.Text
num2 = TextBox1.TextIf num1 = TextBox1.Text Then
showDataType(num1)
ElseIf num2 = TextBox1.Text Then
showDataType(num2)
End If
End SubPrivate Sub showDataType(ByVal num As Integer)
MessageBox.Show("This is an Integer", "Data Type", MessageBoxButtons.OK, MessageBoxIcon.Information)
End SubPrivate Sub showDataType(ByVal num As Double)
MessageBox.Show("This is a Double", "Data Type", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
End Class -
This is overloading
-
coercion is function overloading!!
-
It'd be nice to see how we're supposed to actually use these, and use one over the other
-
so when is the good stuff coming?
I have been waiting for a real aplication, a program that i can go to Start. Open. X program
I now that all this will go into the program and that these are the basics, but it would be encouraging if we were shown and actual program application
This is like studying math for so many years without knowing what the heck is that useful for. -
The correct term is coercion. The non-technical name is overloading.
-
Private Sub showDataType(ByVal num As Boolean)
MessageBox.Show("This is a boolean")
End Sub -
I would have called this overloading?
Leave a Reply