locked
visual studio professional 2013 RC has myopia. RRS feed

  • Question

  • Icomposed a project with visual studio professional 2013 RC. It showed me an error meesage saying, "Cannot use local variable 'oWard' before it is declared."even though I declared 'object oWard' at  10 lines above.

    Thursday, September 26, 2013 2:49 AM

Answers

  • Hi ida89,

    Thanks for posting it in MSDN forum.

    I agree with Mike.

    From the error message, I think it is an issue about variable scope, so I would suggest you refer to the references below.

    http://msdn.microsoft.com/en-us/library/ms973875.aspx

    http://blogs.msdn.com/b/samng/archive/2007/11/09/local-variable-scoping-in-c.aspx

    If the issue persists, I would you suggest you share the code here. Then some other communities like Mike and I can help you to solve it ASAP.

    Regards,

    Damon


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, September 27, 2013 9:53 AM

All replies

  • "It showed me an error meesage saying, "Cannot use local variable 'oWard' before it is declared."even though I declared 'object oWard' at  10 lines above. "

    What makes you think that your code is correct and the compiler is not? Show your code.

    Thursday, September 26, 2013 7:17 AM
  • Hi ida89,

    Thanks for posting it in MSDN forum.

    I agree with Mike.

    From the error message, I think it is an issue about variable scope, so I would suggest you refer to the references below.

    http://msdn.microsoft.com/en-us/library/ms973875.aspx

    http://blogs.msdn.com/b/samng/archive/2007/11/09/local-variable-scoping-in-c.aspx

    If the issue persists, I would you suggest you share the code here. Then some other communities like Mike and I can help you to solve it ASAP.

    Regards,

    Damon


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, September 27, 2013 9:53 AM