Results 1 to 4 of 4

Thread: VB Public Type ... End Type eqv. C# [Resolved]

  1. #1

    Thread Starter
    Hyperactive Member onerrorgoto's Avatar
    Join Date
    Aug 1999
    Location
    Sweden
    Posts
    330

    VB Public Type ... End Type eqv. C# [Resolved]

    What is the syntax in C# for VB's Type declaration
    VB Code:
    1. public type tMyType
    2.   ID as Long
    3.   Name as String
    4. end type
    5.  
    6. public type tSecondType
    7.   Emp as tMyType
    8. end type

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

    Thanks
    Last edited by onerrorgoto; Sep 23rd, 2003 at 04:32 AM.
    Onerrorgoto

    Dont be to optimistic, the light at the end of the tunnel might be a train

  2. #2
    Hyperactive Member Sgt-Peppa's Avatar
    Join Date
    Mar 2003
    Location
    Munich - Germany
    Posts
    476
    Just write a class:

    Code:
    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
    Keep Smiling - even if its hard
    Frankie Says Relax, wossname Says Yeah!
    wossname:--Currently I'm wearing a gimp suit and a parachute.
    C# - Base64 Blog

  3. #3

    Thread Starter
    Hyperactive Member onerrorgoto's Avatar
    Join Date
    Aug 1999
    Location
    Sweden
    Posts
    330

    Thanks

    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.
    Onerrorgoto

    Dont be to optimistic, the light at the end of the tunnel might be a train

  4. #4
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    as a note vb.net uses Struct now also. Type is gone for that.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width