• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Tip: Using multi-line comments

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

    Tip: Using multi-line comments

    I was perplexed that most of the default sample scripts I have look at so far are using two forward slashes at the start of each line to mark a comment section.

    Here is a tip:

    If your comment will run on for multiple lines, write the comment likes this:

    /*
    hi
    this
    is
    a
    multiline
    comment
    */

    I'm not sure if the original comment method was an artifact from an earlier version of ninjascript.

    I know one of the toolbar icons in the editor operates by inserting / removing double forward slashes in front of each selected line, maybe this could be updated in future version 8?

    #2
    Hello balltrader,

    The comments use double lines so that the NinjaScript editor can comment uncomment selected text. Using /* */ for a block of text makes this much more difficult.

    You will find that many examples sent by our staff with multi-line comments will have the comment blocks instead of single line comments. However, our official samples will not.

    Are you requesting that we recode all scripts be recoded to use comment blocks instead of single line comment marks?

    If so, I will enter this as a feature request in your behalf. It is up to our development to decide if a feature request will be implemented and when.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      ha ha that is funny
      no way do I expect you to recode all your scripts, who would pay for that? lol

      i was just making a suggestion to coders, that if you are writing a multi-line comment, use the multiline comment style /* */

      which is a different concept than if you are trying to quickly comment out a chunk of code using the toolbar buttons for testing / debugging

      I am not requesting a feature change to the toolbar icon behavior onclick event. I can understand the purpose and utility of that.

      thank you.

      Comment


        #4
        @Chelsea, can you confirm if there is any performance hit from including long length comments in the script, or since the script is compiled, are the comment (qty and length) of no concern?

        Comment


          #5
          Hello balltrader,

          No, the comments do not cause a performance hit and are not parsed by the computer.

          http://stackoverflow.com/questions/1...ow-down-perfor
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Thanks, I preferred verification instead of just assuming.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Velhinho, Today, 12:30 PM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by EF Hutton, Today, 12:36 PM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Melissa  
            Started by TraderIqbal, Today, 11:17 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_PatrickG  
            Started by frankduc, Today, 11:42 AM
            3 responses
            11 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by bdelorm, Today, 11:10 AM
            1 response
            4 views
            0 likes
            Last Post NinjaTrader_PatrickG  
            Working...
            X