Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. Public Class Form1
  2. Public Function MyFunction() As Integer?
  3. Return Nothing
  4. End Function
  5.  
  6. Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  7. Dim o As Object = Me
  8. MsgBox(TypeName(Me)) ' Form1
  9. MsgBox(TypeName(o)) ' Form1
  10. MsgBox(TypeName(Me.MyFunction())) ' Nothing
  11. MsgBox(TypeName(o.MyFunction())) ' Nothing
  12. ' but
  13. MsgBox(TypeName(Me.MyFunction() + 0)) ' Nothing
  14. MsgBox(TypeName(o.MyFunction() + 0)) ' Integer
  15. End Sub
  16. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement