dim emp as Employee = new Employee
>
(or similar)
watch those properties too for case sensitivity.
Actually vb lets you get away with a variable the same name as a Type.
It just won't let you have two variables of the same (case
insensitive) name like in C#
i.e.
This compiles fine:
Dim employee As New Employee()
employee.Name = "Seth Rowe"
Console.WriteLine(employee.Name)
And even this will work:
Dim Employee As New Employee()
Employee.Name = "Seth Rowe"
Console.WriteLine(Employee.Name)
However in C# you can do this:
Employee Employee = new Employee();
Employee employee = new Employee();
Employee.Name = "Employee 1";
employee.Name = "employee 2";
Console.WriteLine(Employee.Name);
Console.WriteLine(employee.Name);
But the VB version will fail due to case insensitivity:
Dim Employee As New Employee()
Dim employee As New Employee()
Employee.Name = "Employee 1"
employee.Name = "employee 2"
Console.WriteLine(Employee.Name)
Console.WriteLine(employee.Name)
However, for sake of readability, I would follow you suggestion of
using a shortened version of the type name for the variable.
Thanks,
Seth Rowe
On May 14, 10:38 am, "sloan" <s...@ipass.netwrote:
VB.net is not case sensitive.
so in C#
Employee employee = new Employee();
will work
in VB.net
dim employee as Employee = new Employee()
will NOT work
you gotta go with
dim emp as Employee = new Employee
(or similar)
watch those properties too for case sensitivity.
"rowe_newsgroups" <rowe_em...@yahoo.comwrote in message
news:11**********************@e65g2000hsc.googlegr oups.com...
On May 14, 10:20 am, Robert Scheer <rbsch...@my-deja.comwrote:
Hi.
I am trying to port a library from C# to VB.NET. I have 95% of this
code already ported, but I do not know how to translate the line
below:
public override ProblemCollection Check(Member member)
{
Method method = member as Method;
....
}
What kind of construct is this? Is there an equivalent construct in
VB.NET?
Regards,
Robert Scheer
Off the top of my head:
Public Overrides Function Check(member as Member) As ProblemCollection
Dim method As Method = CType(member, Method)
End Function
Thanks,
Seth Rowe