• 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

  • balltrader
    started a topic Tip: Using multi-line comments

    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?

  • balltrader
    replied
    Thanks, I preferred verification instead of just assuming.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    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

    Leave a comment:


  • balltrader
    replied
    @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?

    Leave a comment:


  • balltrader
    replied
    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.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    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.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by pafhjkayfha, Today, 01:10 AM
0 responses
2 views
0 likes
Last Post pafhjkayfha  
Started by BrandonT1292, 06-17-2019, 03:03 PM
2 responses
22 views
0 likes
Last Post thinarthrill  
Started by cbentrikin, Yesterday, 07:46 PM
1 response
7 views
0 likes
Last Post NinjaTrader_Marco  
Started by dr0832, 01-04-2019, 10:34 AM
7 responses
143 views
0 likes
Last Post Lancer
by Lancer
 
Started by RedDuke, Yesterday, 06:14 PM
0 responses
5 views
0 likes
Last Post RedDuke
by RedDuke
 
Working...
X