Is it possible to use default values in C# like the Optional parameters in
VB.NET?

VB.NET (From Beta 2 source example:
Optional ByVal Events As Boolean = True


Old style C++ sample:
Bool Events = true


Can this be done in C#? Or do I need to create 2 versions of the function?


Also,

If I have 3 different constructors, is it possible to call one construtor
from another? Or should I call a single init routine from each constructor?

Example:
public class xx
{
        private int val1;
        private int val2;
        private int val3;

        public xx()
        {
                xx(0,0,0);
        }

        public xx( int v1 )
        {
                xx(v1,0,0);
        }

        public xx( int v1, int v2, int v3 )
        {
                val1 = v1;
                val2 = v2;
                val3 = v3;
        }
}

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to