Results 1 to 3 of 3

Thread: VS 2005 not recognizing variable use

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2004
    Location
    Kansas, USA
    Posts
    352

    VS 2005 not recognizing variable use

    I just upgraded to VS.NET 2005 and it looks good except the compiler is warning me that I am declaring variables and not using them when I actually am. It is giving me "Unused local variable" on TimeMark, ExcelValues, points, X, Y in the following code:
    VB Code:
    1. Dim Progress As New ProgressForm("Writing to Excel")
    2.         Progress.MaxValue = FinalDataArray.GetUpperBound(0) + 1 - Trigger
    3.         Progress.StepValue = 1
    4.         Progress.Open() 'Open progress bar
    5.         Dim TimeMark As Double = 0
    6.         Dim ExcelValues(FinalDataArray.GetUpperBound(0)) As Double
    7.         Dim points As New ZedGraph.PointPairList
    8.         Dim X As Double
    9.         Dim Y As Double
    10.         For i = Trigger To FinalDataArray.GetUpperBound(0) + 1
    11.             Application.DoEvents()
    12.             X = TimeMark
    13.             Y = Conversion.Convert(FinalDataArray(i - 1), Conversion_Class.Type.Weight)
    14.             points.Add(X, Y)
    15.             TimeMark += Increment
    16.             Progress.Increment(1)
    17.         Next
    18.         Progress.CloseForm()

    What's up with this?
    Thanks,
    Eric
    --------------------------------------------------------------------------------------------------------------------
    VB.net/C# ... Visual Studio 2019
    "None of us are as smart as all of us."

  2. #2
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: VS 2005 not recognizing variable use

    I've had the same issue using Visual C# Express 2005. To fix it I built my application a few times and restarted and all was well.

    Looks like you're not doing anything wrong...
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  3. #3
    Hyperactive Member nothingofvalue's Avatar
    Join Date
    Jul 2005
    Location
    Arizona
    Posts
    489

    Re: VS 2005 not recognizing variable use

    Unfortunately, thus far VS 2005 appears to be rather buggy with items like what you have and also controls not changing when you tell them too. Hopefully it will all get fixed soon.
    "Imagination is more important than knowledge..."

    Albert Einstein
    -----------------------------------------------
    If my reply helped you then you really were lost, but I still took the time to help, please rate it anyway

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width