Instead of using one line of code to declare and instantiate it, try breaking it into two lines of code and see if the warning goes away.
Eric On Tue, May 17, 2011 at 12:29 AM, BobRoyAce <[email protected]> wrote: > I have a project that I'm working on in Visual Studio 2010. There are > 62 Warnings shown for the project right now. Many of the warnings are > for supposed unused variables. The weird thing about this is that the > variables are not unused. They are very much used. Here's an example: > > > Dim oForm As New MaintCALegalExpenseForm > oForm.AddEditMode = gci_ADD_EDIT_MODE_EDIT > > Dim oOriginalLegalExpense As CALegalExpense = > gvLegalExcpenses.GetFocusedRow > Dim oNewLegalExpense As New CALegalExpense > oNewLegalExpense = oOriginalLegalExpense.CloneMe(True) > > oForm.CurrentLegalExpense = oNewLegalExpense > > If (oForm.ShowDialog = DialogResult.OK) Then > > _TheCA.LegalExpenses.ReplaceCALegalExpense(oForm.CurrentLegalExpense) > End If > > Visual Studio tells me that the variable oForm, declared in the first > line of code above, is an unused local variable. Is this a known issue > with VS 2010 or am I missing something? > > -- > You received this message because you are subscribed to the Google > Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML > Web Services,.NET Remoting" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en > or visit the group website at http://megasolutions.net > -- You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en or visit the group website at http://megasolutions.net
