Does VB In Visual Studio 2010 Include The YIELD Keyword (yield Return, Yield Break)

Sep 29, 2009

Will Visual Basic in Visual Studio 2010 have the YIELD keyword?If not.... Why?

View 1 Replies


ADVERTISEMENT

VS 2010 - Alternative To YIELD Keyword In VB

Apr 19, 2011

I have a tricky piece of code in C# that I need translated to VB.NET. That's not usually a problem, as I can do it by hand or using one of the many conversion websites. However, this particular piece of code uses the Yield keyword; and I don't know how to work around that. [Code]

View 10 Replies

VS 2010 C# Yield Return In VB?

Feb 2, 2011

I'm converting some C# code and I'm stuck at this line:c# while (iterator.MoveNext()) yield return iterator.Current;

View 4 Replies

How To Convert C# Keyword Yield

Nov 9, 2011

Possible Duplicates: Translation of yield into VB.NETYield In VB.NETI try to convert the C# yield to VB.NET but i found there is no yield in VB.NET

View 1 Replies

C# - Way To Implement Caliburn-like Co-routines In Since There's No Yield Keyword?

Mar 26, 2010

Note that I'm aware of other yield in vb.net questions here on SO. I'm playing around with Caliburn lately. Bunch of great stuff there, including co-routines implementation.

Most of the work I'm doing is C# based, but now I'm also creating an architecture guideline for a VB.NET only shop, based on Rob's small MVVM framework.Everything looks very well except using co-routines from VB. Since VB 10 is used, we can try something like Bill McCarthy's suggestion:

[Code]...

It definitely isn't as elegant as C# version, but it looks to be doable. We'll see if there are any problems with this. If anyone has better idea, I'm all ears.

View 1 Replies

Implement Yield Return For IEnumerable Functions?

May 17, 2009

In C#, when writing a function that returns an IEnumerble<>, you can use yield return to return a single item of the enumeration and yield break; to signify no remaining items. What is the VB.NET syntax for doing the same thing?

[Code]...

View 6 Replies

DataGrid Columns Math - Result Return The Answer In The Unbound Yield Column For That Row Represented As A Percentage?

Sep 20, 2010

I have a table in a data grid the columns are bound to the columns...

SQFT QTY WIDTH LENGTH

i also have added into the datagrid an unbound column called Yeild%.what i'm trying to do is the following formula

SQFT / (QTY * (width * length / 144) and have the result return the answer in the unbound yield column for that row represented as a percentage

So if SQFT = 178 QTY = 2 Width = 144 Length = 102 answer would be 0.87 (rounded)

so this would be 87%

View 7 Replies

C# - Translation Of Yield Into .NET?

Sep 28, 2010

What is the best/easiest way to "translate" it into VB.NET? Especially i tried to convert this code into VB.NET, but i failed with:

yield return new MatchNode(++index, current.Value);

What i have is:

Imports System.Collections
Imports System.Data.SqlTypes
Imports System.Diagnostics.CodeAnalysis

[code]....

View 5 Replies

.net - Identical If() And If Yield Different Results

Dec 22, 2010

What is the difference in the two blocks of code below? I expected them to return the same result, but they don't.

In the case where xml.@Type = "null", I want PatientMetricTypeID (a nullable Integer) to end up being Nothing.

Block #1: If()

In this case, it ends up as 0. It looks like Nothing is being treated as an Integer and converted to 0. I can sort of see why this might happen but not fully... I would like to understand exactly how this works, and if there is a workaround.

Dim PatientMetricTypeID As Integer? = If(xml.@Type = "null",
Nothing,
CType([Enum].Parse(GetType(PatientMetricTypes), xml.@Type), Integer))

Block #2: If

In this case, it ends up as Nothing -- expected behavior.

Dim PatientMetricTypeID As Integer?

If xml.@Type = "null" Then

[CODE]...

View 3 Replies

Null String Yield An Error

Sep 10, 2009

I have the following code below which has an error. When the checkbox is set to true and for example change the "role", and click save the following error is given;

"Index was outside the bonds of the array".

I know the reason of the error but don't know the solution..

The TxtPayCont is a concatenation of title, fname, and lname in an array. Therefore, if all the fields have values, then it works fine. So if it is Mr Jones Tim, this works, but, if it is Mr Jones it does not. It has to have 2 spaces to work. Is there anyway round this...

(see code below)..

Code:

View 1 Replies

.net - Yield/Sleep/throttle Another Thread While It Is Executing A Method In An External Library - Specifically Jurassic?

Jun 25, 2012

I am using a .Net JavaScript implementation called Jurassic to run user-controlled scripts within my .Net 4 WPF application coded in VB.Net - C# answers are fine. The script engine runs on its own thread and provides an API for the script to interact with my application. This all works really nicely until a user executes a script that causes an infinite loop and takes out a core of the processor.

[Code]...

The reason I care about keeping the thread alive is because the user who wrote the script and the user who is running it may not be the same, and I want to keep the experience as smooth as possible the the user running the thread. There also might be legitimate situations in which a single JavaScript function would run for a long time and I do not want to kill that, I just want to stop being allowed to hog the resources.

Solutions that involve stopping the thread from slowing down the system but that still show high CPU usage are not preferable because I do not want the user to wrongly feel that the application is resource intensive.

View 1 Replies

Use LINQ To Filter Collection Of Nested Classes To Yield Dictionary Of Unique Properties Of Those Classes?

Jan 23, 2012

I have two classes, one nested in the other. [code]Neither "Name" or "ID" are unique between operations and records.I wish to construct a dictionary using LINQ = Dictionary(Of String, Of List(Of Integer), whereby the keys are uniqe examples of Names in my collection and the values are the collective set of distinct IDs that are associated with those names.

View 2 Replies

Converting C# Program To VB - Use "Yield" Statement ?

Feb 23, 2012

I am converting C# program to VB. I heard that "Yield" statement is ready from Visual Studio 2010 SP1.

[URL]

I updated my developing environment to Visual Studio 2010 SP1. However IDE still displays error to the following code saying that "yield" is not delclared.

Public Class WeakCollection(Of T)

Implements IEnumerable(Of T)...

ReadOnly innerList As List(Of WeakReference) = New List(Of WeakReference)()

[CODE]...

How can I use "Yield" statement in VB?

View 3 Replies

Visual Studio 2010, Outlook 2010 And Windows Application, Return Emails?

Jan 5, 2011

At present I have wrote an application (in-house CRM, vb .net 2010) which allows me to send emails under the selected customer & I categorised these emails.As these are categorised I can return data to display email history in my program by using search criteria:

Dim oMail As Outlook.MAPIFolder = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderSentMail)
Dim sSearch As String
sSearch = "[Categories] = '" + "[" + tAccount.Text.Trim + "]" + "(" + tShipTo.Text.Trim + ")'"
Dim oItems As Outlook.Items = oMail.Items.Restrict(sSearch)

However the limitation to the above is it only looks at sent items & no other folder.My ideal solution would be to display all email correspondence for a certain contact.

View 1 Replies

Visual Studio 2010 - .NET Function As String, Will Return False Be A Boolean?

Sep 21, 2011

I have a HTTP class that gets content from URL's, POST's content to URL's etc and then returns the raw HTML content.In the function inside of the class it detects if there is a HTTP error and if so I would like to return false but will this work if I have declared the function to return a String?

Code Sample of what I am trying to do (Note the Return Content & Return False if a HTTP error code is detected)Public Function Get_URL(ByVal URL As String) As String

[Code]...

View 1 Replies

Visual Studio 2010 - Return Value Of Method. System.__Com.object?

Apr 10, 2012

I know it's a stupid question but I cannot find info about it.

Public Function TestFunc() As String

Dim lMapper = cRouter.StaticPortMappingCollection
Dim lMappedPort As NATUPNPLib.IStaticPortMapping
Dim Test As String

[Code]...

How to get this value? By my way I get *System.__ComObject*

View 1 Replies

Visual Studio - Adding A Keyword To .net?

Aug 22, 2011

IsNot Nothing is very common, but it's a double negative =o I'd like to use Exists instead. Is there someway I can add a keyword to my VB vocab?For now, I wrote an extension that adds _Exists() as a property to each object. I use this frequently, but I'd still prefer an actual keyword.

<HideModuleName()>
Public Module CustomExtensions
''' <summary>

[code]....

I use Visual Studio 2010 exclusively, so if I could trick VS into converting my custom phraseology into the standard syntax, that'd work for me.

View 1 Replies

Add A Line Break In A Multi Line Textbox In Visual Studio Designer's Property Section?

Jun 14, 2012

This is a WinForm VB.NET application. Please see the picture below:How to add a line break in a multi line textbox in Visual Studio designer's property section?I tried using abc & Environment.NewLine & def but that was not working.

View 2 Replies

Visual Studio 2008 Sp1 To Visual Studio 2010 Beta Sp2

Feb 17, 2010

Will i be able to successfully install 2010 beta 2 side by side 2008? because i want to test 2010 features and some development toolkits such as silverlight while i don't want to uninstall my visual studio 2008 professional.

View 2 Replies

.net - Which Version Of Visual Studio 2010 Contains Visual Basic SharePoint Templates

Aug 5, 2011

Does anybody know which version of Visual Studio 2010 contains the full set of Visual Basic SharePoint Templates? I am about to embark on a project to create Visual Web Parts to be used in a SharePoint report.

At the moment I am using Visual Studio 2008 and even though the WSPBuilder is installed none of the relevant SharePoint templates are present.Having searched SO and the web, most advise to install the templates via the Visual Studio command prompt: devenv /installvstemplates

Alas the Visual Studio command prompt is also missing from my VS2008 installation.So, the question remains: which version of VS2010 contains what I need for pain-free SharePoint development? There is a rather large price different between VS2010 Professional and VS2010 Premium, so can anyone tell me if the cheaper version (VS2010 Professional) contains all the Sharepoint templates?

View 3 Replies

IDE :: Adding References In Visual Studio 2010 Beta 2 (Visual Basic)?

Nov 25, 2009

I am just wondering how I can add Direct X references to Visual Basic in Visual Studio 2010 Beta 2. I cant find them in the .NET reference list, or the reference list, or anywhere. I downloaded the Direct X SDK for August 2009, but I can not add the .dll files to the reference list. Is there anything I can do to add them? I need the references for programming reasons.

View 5 Replies

Use OpenGL In Visual Studio 2010 In Visual Basic Project?

Jan 15, 2012

I want to use "OpenGL" in my project. Is it possible to associate it with "Visual Basic" application developed in Visual Studio 2010? If yes then how can we do it.

View 1 Replies

Convert Visual Basic 2010 To Visual Studio Pro 2010?

Apr 20, 2012

I have a project in visual basic 2010 and want to convert it to visual studio 2010 so I don't have to chose the "open with" every time. Is there a tutorial on how to do this?

View 4 Replies

Asp.net - Force Visual Studio 2010 To Use Visual Basic 10?

Mar 9, 2012

To reproduce the error I'm getting:Create a new Visual Studio 2010 ASP.NET web site in Visual Basic, targeting .NET 2.0Type "Public Property Test As String" Observe "Visual Basic 9.0 does not support auto-implemented properties." error Visual Studio 2010 is happy to use VB 10 against .NET 2.0-targeted Windows Forms applications, this only appears to be an issue with ASP.NET.Is there a way to force Visual Studio 2010 to use VB 10 when targeting .NET 2.0?

View 1 Replies

Build 64-bit Visual Basic.NET In Visual Studio 2010?

Jul 6, 2010

have just overlooked something somewhere...I am writing VB.NET stuff in VS2010 on Windows 7 64-bit. It seems to build by default for a 32-bit target, how to I tell it to make a 64-bit executable?

View 2 Replies

C# - Web Matrix Differ From Visual Studio - Is It More Efficient Than Visual Studio To Develop ASP.NET Web Project

Oct 12, 2011

WebMatrix is a web development and deployment tool by Microsoft so how is this compared to Visual Studio? which Use C# Razor Syntax is that more better coding.

[Code]...

View 2 Replies

No Return Keyword For Function In .NET?

Aug 5, 2011

I've been doing some code review and this code seemed weird to me since it doesn't have any return statement:Protected Function AddZero(ByVal vsInput As String) As String

If Len(vsInput) = 1 Then
AddZero = "0" & vsInput
Else
AddZero = vsInput
End If
End Function

View 2 Replies

Compile A Solution In Visual Studio 2005 Which Was Compiled In Visual Studio 6?

Sep 15, 2009

I have to compile projects which was compiled in Visual Studio 6 in Visual Studio 2005. When i compiled i got a set of same error. I opened the project for VS6 by selecting File->open->project/solution and tried to build a solution by Build option but i am getting the following error.

[Code]...

View 7 Replies

Open Visual Studio Express Files With Normal Visual Studio?

Apr 11, 2011

Is it possible to open visual studio express files with normal visual studio?

View 2 Replies

VS 2010 Change Version After Install-Visual Studio 2010 Installer

Jun 21, 2010

Well I used the Visual Studio 2010 installer to install my application and I want it to be able to change the version displayed in the in the Add/ Remove Programs (in the Control Panel). How can I do this without going through the install wizard again?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved