|
-
Jan 17th, 2004, 02:00 AM
#1
Thread Starter
Lively Member
Help...
What is the equivalent when you put in VB like this
VB Code:
Private Sub Hi()
PartOne:
'code
PartTwo:
Goto PartOne
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."
-
Jan 17th, 2004, 02:28 AM
#2
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.
-
Jan 17th, 2004, 03:28 AM
#3
Sleep mode
Or rarely , you have to use Recursion that loops inside the method itself but it depends on the functionality you're implementing .
-
Jan 17th, 2004, 10:29 AM
#4
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|