Results 1 to 3 of 3

Thread: [4.0] Named parameters. Anyone used the CTP yet?

  1. #1

    Thread Starter
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913

    [4.0] Named parameters. Anyone used the CTP yet?

    I was curious about something from those that have or have tried the 2010 CTP. With the new named parameters feature, do you need to have the parameters in order when calling now or can they be in any order?

    For example
    Code:
    private void MyMethod(string parameter1, int parameter2)
    {
    
    }
    
    private void CallMyMethod()
    {
         MyMethod(parameter2: 1, parameter1: "Hey");
    }
    Just something I was curious about.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  2. #2
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    710

    Re: [4.0] Named parameters. Anyone used the CTP yet?

    They can be in any order.
    However, if you have some unnamed parameters, then the unnamed parameters must precede the named parameters and be in order.
    David Anton
    Convert between VB, C#, C++, & Java
    www.tangiblesoftwaresolutions.com

  3. #3

    Thread Starter
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913

    Resolved Re: [4.0] Named parameters. Anyone used the CTP yet?

    Thanks
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width