PDA

Click to See Complete Forum and Search --> : VB Public Type ... End Type eqv. C# [Resolved]


onerrorgoto
May 23rd, 2003, 07:22 AM
What is the syntax in C# for VB's Type declaration

public type tMyType
ID as Long
Name as String
end type

public type tSecondType
Emp as tMyType
end type


I have just installed VS.NET 2003 and I dont like the dynamic help and MSDN tha was shipped with it :(

Thanks

Sgt-Peppa
May 23rd, 2003, 07:40 AM
Just write a class:


class test{
string name
string bla

public test(string n, string m)
{
name = n
bla = m
}
public String Name
{
get{return name;}
}
public String bla
{
get{return bla;}
}



Just an example,

Hope I could help,

Stephan

onerrorgoto
May 23rd, 2003, 08:00 AM
Im in the process of porting a vb6 project to C# and Webforms.
The types is Private and therefore I dont want to make properties of them.
I got the advise from another forum that I should use:
private struct MyType
{
}

But thanks for your reply.

Cander
May 23rd, 2003, 08:08 AM
as a note vb.net uses Struct now also. Type is gone for that.