D
DDF
I took this snippet from a book I foudn online. Public Class Demo
Public Structure ValueDemo
Public X As Integer
End Structure
Public Class RefDemo
Public Y As Integer
End Class
Public Sub InstantiateTypes()
' This line declares a ValueDemo variable
Dim DemoStructure As ValueDemo
' This line creates an instance of ValueDemo on the stack
DemoStructure = New ValueDemo()
' The variable is ready to receive data.
DemoStructure.X = 15
' This line declares a RefDemo variable, but doesn't
' create an instance of the class
Dim DemoClass As RefDemo
' This line actually creates the object
DemoClass = New RefDemo()
' And you can now assign value to its members
DemoClass.Y = 15
End Sub
End ClassWhen trying to compile The ide si telling me that this is not a valid namespace. Can anyone help...Thanks...
Public Structure ValueDemo
Public X As Integer
End Structure
Public Class RefDemo
Public Y As Integer
End Class
Public Sub InstantiateTypes()
' This line declares a ValueDemo variable
Dim DemoStructure As ValueDemo
' This line creates an instance of ValueDemo on the stack
DemoStructure = New ValueDemo()
' The variable is ready to receive data.
DemoStructure.X = 15
' This line declares a RefDemo variable, but doesn't
' create an instance of the class
Dim DemoClass As RefDemo
' This line actually creates the object
DemoClass = New RefDemo()
' And you can now assign value to its members
DemoClass.Y = 15
End Sub
End ClassWhen trying to compile The ide si telling me that this is not a valid namespace. Can anyone help...Thanks...