Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

is it possible to pass param. names and arguments together when calling a function?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    is it possible to pass param. names and arguments together when calling a function?

    If one defines this function private void multiplyNumbers( int x, int y)

    When we call it, is it possible to pass the parameter names and arguments together like this:

    result = multiplyNumbers(x = 10, y = 25)

    When i try this with Ninjascript i get an error.

    #2
    I think i found my own answer:

    Comment


      #3
      Hello trenedisyourfriend,

      Thank you for your post.

      This would be a C# related question. Please note that it is against our policy to provide C# programming education services in our Support department.

      That said, the link you mentioned would be a good place to look for education on this topic. If you have a custom method, private void multiplyNumbers(int x, int y), then you would call that method as follows.

      multiplyNumbers(10, 25)

      I have personally found DotNetPerls to be a very helpful publicly available educational resource with simple, direct, and easy-to-follow examples.


      Other useful resources on learning C# that are publicly available:
      NinjaScript Debugging
      Softsteel Soluions
      CSharp Essentials
      C# Station
      The Code Project

      Let us know if we may assist further.
      <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

      Comment


        #4
        Thank you Brandon for your link.

        From the link i posted, i now know i can use these forms too:
        multiplyNumbers(x: 10, y: 25) or multiplyNumbers(y: 25, x: 10)

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        576 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X