PC Review


Reply
Thread Tools Rate Thread

how does C# "yield" translate into VB.NET?

 
 
=?Utf-8?B?aGVyYmVydA==?=
Guest
Posts: n/a
 
      3rd Apr 2006
How does the following C# code look like in VB.NET?

IEnumerator<T> IEnumerable<T>.GetEnumerator()
{
foreach (Node<T> node in this.headNode)
{
yield return node.Data;
}
}


thanks herbert

 
Reply With Quote
 
 
 
 
Mattias Sjögren
Guest
Posts: n/a
 
      3rd Apr 2006

>How does the following C# code look like in VB.NET?


There's no direct translation since VB.NET doesn's have that feature
(iterators). You have to manually implement IEnumerable and maintain
the state machine.


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
 
Reply With Quote
 
=?Utf-8?B?aGVyYmVydA==?=
Guest
Posts: n/a
 
      3rd Apr 2006
Mattias,

is there any URL you recommend that helps me to start this?
herbert
 
Reply With Quote
 
Laura T.
Guest
Posts: n/a
 
      4th Apr 2006
This might help:

http://support.microsoft.com/kb/322025

Laura

"herbert" <(E-Mail Removed)> ha scritto nel messaggio
news:76F317AD-65B4-4EA7-9FF0-(E-Mail Removed)...
> Mattias,
>
> is there any URL you recommend that helps me to start this?
> herbert



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
translate big solution from "just default english" to "manylanguages" per9000 Microsoft C# .NET 1 19th Sep 2008 10:53 PM
In WORD, "translate/ look up" dosn't work, saying "No result". Haegil CHO Microsoft Word Document Management 0 7th Jul 2008 09:21 PM
DataTable.NewRow calls yield "Value was either too large or too smallfor an Int32" Lee Gillie Microsoft ADO .NET 0 15th Jun 2007 12:30 AM
MSNStockQuote AddIn for Excel should include a "YIELD" option. =?Utf-8?B?Sm9obiBTbWl0aA==?= Microsoft Excel Misc 0 15th Nov 2005 05:45 AM
How to translate VB code InStr(1, sDocName, """") to C# =?Utf-8?B?Y2xvdWR4?= Microsoft C# .NET 4 6th May 2005 02:47 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:10 PM.