First of all, you should always keep your return codes to a single meaning,
preferably a simple type to indicate the function's status.  There is a book
that I bought 15 years ago that did the best job of explaining it: "Writing
Solid Code: Microsoft's Techniques for Developing Bug-Free C Programs" by
Steve Maguire.  http://tinyurl.com/5m77k4
If you need to return data from the function, it is best to utilize output
parameters in the function.  If there is a large number of output
parameters, you can easily pass them back as their own data class.

Obviously, there are exceptions to this as in working with property
setter/getter functions.

If you feel you need to return more than one type, then you need to examine
your design.  Functions (methods) should be discrete entities that should
perform a single, definable process.  If you're having to return multiple
types, then your function is most likely not properly defined.

...Glenn

On Tue, Sep 9, 2008 at 1:21 AM, VIKAS GARG <[EMAIL PROTECTED]> wrote:

> Can we have two different kind of return types in a single function
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web 
Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---

Reply via email to