Re: VisualBasic.Compatabilty . Goto
Frans Bouma <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.advanced |
|---|---|
| Message-ID | <001601c97fc9$fffaf280$fff0d780$@nl> |
> Dear Ladies and Gentlemen,
>
> I present for you delectations tonight the one and only GOTO.
>
> try
> {
> int iCnt2 = 1;
>
> Common cm = new Common();
> tryagain:
>
> try
> {
> oWait.WaitOne();
> if (!FTPClients.AddFTPClient(ftp))
> {
> ScheduleStatus.AddEditSchedule(new
> ScheduleInfo(_schedule.scheduleID, "Downloding Waiting " ,
> DateTime.Now.ToString(), _schedule.providerName, _schedule.customerName,
> _schedule.contractName, ""));
> oWait.ReleaseMutex();
> if (cm.WatchAgain(ref iCnt2))
> {
> goto tryagain;
>
> }
> }
>
> The above code is in a C# application that I'm auditing, one of the
> developers at some stage has added a reference to VisualBasic.Compatabilty
> so that they could use the goto statement, luckly this isn't in a
production
> environment yet. Apart from being very very ugly and a huge kludge can
> anyone give me some good reasons to remove the VisualBasic.Compatiblity
> assembly and as a by product get them to refactor this code?
You don't need the compatibility assembly for 'goto', goto is a
normal C# keyword. I think they added it for something much worse: error
resume next
FB
===================================
View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives