I had a question... I am trying to figure something out, so I can be more confident with my coding.
In a batch file, this is how I do it...
Code Code Code Code Code Code Code Code Code Code Code Code Code |
how do I do exactly that, in c# ? ... how do I use goto in c# ? like, skip what ever else comes next, and skip to that specific line next..
Thanks guys.

theLizardRank #1,079 · 1.8K reputationPosted Jan 9, 2011, 3:44 PM EST
Without knowing what you want to achieve and taking a guess as to what you want a switch may be your option.
switch(whatever)
{
case "hello":
place1();
break;
case "place1":
place2();
break;
}
thiago costaRank #6,113 · 276 reputationPosted Jan 9, 2011, 5:55 PM EST
theLizardRank #1,079 · 1.8K reputationPosted Jan 9, 2011, 8:29 PM EST
Question is, what do you want to achieve, where do you want to go after, goto's are usually associated with procedural programming but this is rarely done these days so you need to think in terms of event driven functions/methods.
Mahesh ChandRank #1 · 393.3K reputationPosted Jan 9, 2011, 8:35 PM EST
I just watched your video on electric meter. Very smart. I am impressed. If it is available for free, please feel free to upload it to the Downloads section of the site for our users.
theLizardRank #1,079 · 1.8K reputationPosted Jan 9, 2011, 9:41 PM EST
I appreciate the kind comments but I am not sure how it would benefit this forums users since the program is written in C++ builder using propriety technology which I developed and is specific to Australian conditions with no source code being available.
Edit:
Mahesh, as an after thought, I know that C# Corner is for C# but if you are willing to start a section for C++ Builder I would be happy to help get it going.
thiago costaRank #6,113 · 276 reputationPosted Jan 10, 2011, 1:35 PM EST
I think I know what you mean...
The reason why I asked, is because ... for example"
Client.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed); Client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged); private void ProgressChanged(object sender, DownloadProgressChangedEventArgs e) { } private void Completed(object sender, AsyncCompletedEventArgs e) { }I think you got the keyword... I wan't to be able to use events comfortably ... But I get a bit confused...
Like in the example above... The event makes the COMPLETED be executed right after it is completed....
This is awesome... This type of thing would make programming so powerful to me...
It's just that, I don't feel too comfortable with the language yet...
Do you have any tips, to help me master event handle and event args ?
Thx man... :D
theLizardRank #1,079 · 1.8K reputationPosted Jan 10, 2011, 4:23 PM EST
for example, a click of a button can have a number of conditions, a plain click, left or right button click or combination with shift, ctrl, alt so that depending on which combination you call an appropriate function / method, these are things that you learn with experience.
thiago costaRank #6,113 · 276 reputationPosted Jan 10, 2011, 5:35 PM EST
Thank you... I read much about c# day by day...
I skipped all the console application tutorials that came with my book ... :D .. Maybe that was a bad idea...
But ...
I promisse that I will not give up and I will keep up the learning...
Thx man
theLizardRank #1,079 · 1.8K reputationPosted Jan 10, 2011, 5:47 PM EST
Not really, I don't bother with console stuff at all, to me it is learning something that I will never use, better to learn something that I will use instead of wasting time and effort.
If there is anything that you learn from me let it be that you think outside the square and develop new ideas, don't let others tell you that some things cannot be done (other than the physical) and always believe that there is a solution to every problem no matter how small or large it may be.
Sam HobbsRank #107 · 20.5K reputationPosted Jan 10, 2011, 7:55 PM EST
The advantage of console programs is that you can use them to just do programming that does not need a UI. You often can do things faster without messing with a UI. If the book used console programs to show examples of C#, then you might be missing a lot by skipping over console programs. I often use console programs to figure out how to program something then copy code from the console program to a UI program. A console program is capable of a text-based UI but I don't use that.