Yield (keyword)
From The Oxygene Language Wiki
This is a Language topic
Feel free to add your notes to this topic below.
Yield is used to exit from an Iterator, saving the point where it was left off, so the next "MoveNext" call in the iterator resumes there. Yield only works from within an iterator method.
Yield expects a parameter of the iterator's sub type. So for an iterator typed "sequence of string", it will expect a string type to return. Yield cannot be used from within a try or locking statement, as there is no guarantee that the caller will actually return and call MoveNext again. Yield also accepts a sequence of the same type it was defined with. When this is used it will return all those items.
See Also
Area: Oxygene Language
Compiler version: Oxygene 5
Language Glossary — Keywords — Types — FAQ — How To