Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 11, 2011 01:51 PM by interwanderer1
May 11, 2011 12:06 PM|LINK
I am working on an application and converting existing ASP code to ASP.NET. The ASP page calls to COM components written in VB 6.0.
I have noticed that many of the methods are using ByRef keyword in some of the parameters. As per my understanding, ByRef modifies/updates the original parameter passed to the method.
I would like to change this functionality in .NET and don't want to use ByRef/ref/out parameters in functions as part of coding standards.
Can any one please suggest me what approach should I take? Do I need to logically divide the function into multiple functions so that ByRef keyword need not be used?
Any help would really be appreciated.
May 11, 2011 01:51 PM|LINK
If these methods are subroutines, then you can change them in to functions and add a return parameter.
Otherwise, the out keyword is best..... thanks to this you will avoid using global parameters.... so byref wasn't such a bad approach at the time....