Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Function without an 'As' clause; return type of Object assumed

Reply
Thread Tools

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

 
 
Rick
Guest
Posts: n/a
 
      08-31-2007
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




 
Reply With Quote
 
 
 
 
sloan
Guest
Posts: n/a
 
      08-31-2007

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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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
>
>
>
>



 
Reply With Quote
 
 
 
 
Rick
Guest
Posts: n/a
 
      08-31-2007
I figured that would be the case. Thanks!

"sloan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> 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" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> 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
>>
>>
>>
>>

>
>



 
Reply With Quote
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      09-03-2007
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 ((E-Mail Removed), 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
One type traits class (or something like that) to get the return type of a pointer to function Diego Martins C++ 5 09-05-2006 08:38 PM
write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function parameter komal C++ 6 01-25-2005 11:13 AM
BC30289: Statement cannot appear within a method body. End of method assumed. Carlos Oliveira ASP .Net 0 08-19-2004 07:51 PM
getting return value from function without return statement. Seong-Kook Shin C Programming 1 06-18-2004 08:19 AM
ASP.NET: BC30289: Statement cannot appear within a method body. End of method assumed. Mike Wilmot ASP .Net 0 12-15-2003 07:49 PM



Advertisments