?
Solved

New Iterator- Need help here Understanding its useage

Posted on 2013-05-14
3
Medium Priority
?
179 Views
Last Modified: 2013-05-16
Just as the subject line says

I dont really understand this .... my question is .... can someone demonstrate a simple usage and explain why this is a benefit to me
0
Comment
Question by:vbMarkO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 42

Assisted Solution

by:sedgwick
sedgwick earned 1000 total points
ID: 39163891
Iterators is a feature since .net 2.0. and simply use yield return which means that the current location in code is remembered to return each element one at a time.
here's a nice example from msdn:
http://msdn.microsoft.com/en-us/library/vstudio/dscyy5s0.aspx
0
 

Author Comment

by:vbMarkO
ID: 39167106
Yes I am familiar with the examples there including the animals one and so on ....

And I read the articles concerning it but Im just not wrapping my head around it ...

I mean why would I want the current location in code remembered?

I am sure I am over looking the obvious ... was just hoping someone could give an example of how n why I might use it
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 1000 total points
ID: 39167449
I think Iterator is mainly used internally such as to implement the ForEach loops. I have never used it in my own code.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question