Function without an 'As' clause; return type of Object assumed

Discussion in 'ASP .Net' started by Rick, Aug 31, 2007.

  1. Rick

    Rick Guest

    We have a very large web project, during migration from VS 2003 to VS 2005,
    I'm getting hundreds of warnings:
    "Function without an 'As' clause; return type of Object assumed." I know
    this is not the proper way of coding, but when you inherit code from earlier
    developers there's not much you can do about it.
    I know you can suppress this warning, but will this cause any problems, one
    of our developers came across this and the function actually returned a
    value of "system.string" or something like that. Is there some configuration
    or setting that can force it to not assume object?

    Thanks in Advance!
    Rick
     
    Rick, Aug 31, 2007
    #1
    1. Advertising

  2. Rick

    sloan Guest

    You can go to the project properties and turn off

    Option Explicit
    and/or
    Option Strict

    which would be a HORRIBLE MISTAKE in my opinion.

    ........

    Go through now and fix them is my advice.
    and return the correct objects.

    Your "hundreds of warnings" will take less time to address now, then the
    mainteance issues you'll have of lack of strong typing in your code later.




    "Rick" <> wrote in message
    news:%...
    > We have a very large web project, during migration from VS 2003 to VS
    > 2005, I'm getting hundreds of warnings:
    > "Function without an 'As' clause; return type of Object assumed." I know
    > this is not the proper way of coding, but when you inherit code from
    > earlier developers there's not much you can do about it.
    > I know you can suppress this warning, but will this cause any problems,
    > one of our developers came across this and the function actually returned
    > a value of "system.string" or something like that. Is there some
    > configuration or setting that can force it to not assume object?
    >
    > Thanks in Advance!
    > Rick
    >
    >
    >
    >
     
    sloan, Aug 31, 2007
    #2
    1. Advertising

  3. Rick

    Rick Guest

    I figured that would be the case. Thanks!

    "sloan" <> wrote in message
    news:...
    >
    > You can go to the project properties and turn off
    >
    > Option Explicit
    > and/or
    > Option Strict
    >
    > which would be a HORRIBLE MISTAKE in my opinion.
    >
    > .......
    >
    > Go through now and fix them is my advice.
    > and return the correct objects.
    >
    > Your "hundreds of warnings" will take less time to address now, then the
    > mainteance issues you'll have of lack of strong typing in your code later.
    >
    >
    >
    >
    > "Rick" <> wrote in message
    > news:%...
    >> We have a very large web project, during migration from VS 2003 to VS
    >> 2005, I'm getting hundreds of warnings:
    >> "Function without an 'As' clause; return type of Object assumed." I know
    >> this is not the proper way of coding, but when you inherit code from
    >> earlier developers there's not much you can do about it.
    >> I know you can suppress this warning, but will this cause any problems,
    >> one of our developers came across this and the function actually returned
    >> a value of "system.string" or something like that. Is there some
    >> configuration or setting that can force it to not assume object?
    >>
    >> Thanks in Advance!
    >> Rick
    >>
    >>
    >>
    >>

    >
    >
     
    Rick, Aug 31, 2007
    #3
  4. Hi Rick,

    I agree with sload, turning off those options is not recommended,
    especially for a big project. My suggestion is to fix those warnings
    instead of disabling them.


    Regards,
    Walter Wang (, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Walter Wang [MSFT], Sep 3, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike Wilmot
    Replies:
    0
    Views:
    3,292
    Mike Wilmot
    Dec 15, 2003
  2. Carlos Oliveira
    Replies:
    0
    Views:
    18,969
    Carlos Oliveira
    Aug 19, 2004
  3. Matt
    Replies:
    40
    Views:
    14,524
    Dale King
    Apr 15, 2006
  4. Seong-Kook Shin
    Replies:
    1
    Views:
    495
    Richard Bos
    Jun 18, 2004
  5. Diego Martins
    Replies:
    5
    Views:
    486
    Diego Martins
    Sep 5, 2006
Loading...

Share This Page