You can use overloading to simulate default/optional parameters.

void foo()              { foo("defaulted"); } // calls the one argument version
void foo(string s)      { foo(s, 10);       } // calls the main function
void foo(string, int i) {}

David

----- Original Message -----
From: "Kirk Jackson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 06, 2002 9:00 PM
Subject: [DOTNET] CSharp and optional parameters


Hi,

When using old DLL's from within C#, there are some methods that take
optional parameters. In VB you can just leave those parameters out, but
in C# it seems that you have to give values for every parameter, meaning
that you need to figure out what each default value is (somehow!).

Is this correct?

Thanks,

Kirk

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

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