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 Jon17, Today, 04:33 PM
        0 responses
        1 view
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        4 views
        0 likes
        Last Post Javierw.ok  
        Started by timmbbo, Today, 08:59 AM
        2 responses
        10 views
        0 likes
        Last Post bltdavid  
        Started by alifarahani, Today, 09:40 AM
        6 responses
        40 views
        0 likes
        Last Post alifarahani  
        Started by Waxavi, Today, 02:10 AM
        1 response
        19 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Working...
        X