DotNetKick.com is an open-source project. Please report any bugs and let us know your great suggestions. Currently running svn revision 620 (rss)

Kick Spy!, Kick Zeitgeist and Kick Widgets

33
kicks
published 10 months, 26 days ago, submitted by rprouse rprouse 10 months, 27 days ago

alteridem.net — The yield statement is another often overlooked keyword that was introduced in .NET 2.0. It is used to return items from a loop within a method and retain the state of the method through multiple calls.

Add a comment 2 comments | category: | Views: 23 | Get KickIt image code
tags: , | tag it

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:

Comments:
This is a useful article and I honestly didn't know about yield break, but two better articles (in my opinion) are:

http://msdn2.microsoft.com/en-us/vcsharp/bb264519.aspx
http://blogs.msdn.com/wesdyer/archive/2007/03/23/all-about-iterators.aspx
posted by senfo 10 months, 26 days ago
If you're interested in how the yield keyword actually works, read this:

http://startbigthinksmall.wordpress.com/2008/06/09/behind-the-scenes-of-the-c-yield-keyword/
posted by lcorneliussen 1 month, 8 days ago



information Login or create an account to comment on this story
 

Sponsored Link: www.carlist.ie

Search:

Ads via The Lounge