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

R

Rick

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
 
S

sloan

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.
 
R

Rick

I figured that would be the case. Thanks!

sloan said:
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.
 
W

Walter Wang [MSFT]

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 ([email protected], 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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top