Click here to Skip to main content
15,895,777 members
Articles / Programming Languages / C#

The goto-less goto!

24 Jan 2011CPOL 1K   2
While I don't recommend it for many situations, here is an alternate for C# that makes use of delegates:// A random number to avoid unreachable code warning.int x = (new Random()).Next();// Action is new to .Net 3.5.Action a = new Action(delegate(){ // goto Exit; if (x <...
Only logged in members can view this content

Please go to the C# Table of Contents to view the list of available articles in this section.