Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Anyone managed to use the List<T> class in NT?

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

    Anyone managed to use the List<T> class in NT?

    Hello,

    I am trying to concatenate a series of strings to create a single string for use with the Print() method to write a series of datapoints to the Output window on a single line. The List<T> class seems ideal for my needs as it includes a separator option.

    Has anyone succeeded in using this class to concatenate with a separator in NT? See here:

    http://msdn.microsoft.com/en-us/libr...(v=vs.90).aspx

    NT does not seem to recognise the List class however, and I'm not sure why...

    Any suggestions welcome!

    Update: just to clarify, the List class creates a string array that can subsequently be concatenated easily using the string.Join() method.
    Last edited by ours_solaire; 04-13-2014, 08:15 AM. Reason: Add information

    #2
    Originally posted by ours_solaire View Post
    Hello,


    NT does not seem to recognise the List class however, and I'm not sure why...

    Any suggestions welcome!

    Update: just to clarify, the List class creates a string array that can subsequently be concatenated easily using the string.Join() method.

    Without seeing your code and includes - Did you include System.Collections.Generic ?

    Comment


      #3
      Hey Sledge,

      Thanks for your input. I just realised after posting that string.Join can be used with a normal string array, so I will just do that.

      Comment


        #4
        Originally posted by ours_solaire View Post
        Hey Sledge,

        Thanks for your input. I just realised after posting that string.Join can be used with a normal string array, so I will just do that.
        Even better, if what you describe is all that you want to do, using a String.Format() gives you even better control.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Jimmyk, 01-26-2018, 05:19 AM
        6 responses
        835 views
        0 likes
        Last Post emuns
        by emuns
         
        Started by jxs_xrj, 01-12-2020, 09:49 AM
        6 responses
        3,291 views
        1 like
        Last Post jgualdronc  
        Started by Touch-Ups, Today, 10:36 AM
        0 responses
        11 views
        0 likes
        Last Post Touch-Ups  
        Started by geddyisodin, 04-25-2024, 05:20 AM
        11 responses
        62 views
        0 likes
        Last Post halgo_boulder  
        Started by Option Whisperer, Today, 09:55 AM
        0 responses
        9 views
        0 likes
        Last Post Option Whisperer  
        Working...
        X