Results 1 to 4 of 4

Thread: Help...

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108

    Help...

    What is the equivalent when you put in VB like this

    VB Code:
    1. Private Sub Hi()
    2. PartOne:
    3. 'code
    4. PartTwo:
    5. Goto PartOne
    6. End Sub

    Is there an equivalent to that in C#?
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

  2. #2
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    GOTO STATEMENTS ARE EVIL, DON'T USE THEM!

    That being said, look:

    A Sub is a function that doesn't return anything, so you'd use
    Code:
    private void Hi()
    {
         //Code Here
    }
    As for the rest of it, GOTOs shouldn't be used. If you need to return to another spot, use loops or maybe a function.

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Or rarely , you have to use Recursion that loops inside the method itself but it depends on the functionality you're implementing .

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108
    oh well, thanks anyway. I am fed up with VB anyhow.
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

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