Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pre-processor ignores /* */ comments

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

    Pre-processor ignores /* */ comments

    Hi,

    I've had this issue happen on 2 different source files and it caused me considerable frustration before I realised what was happening.

    I was taking some code out of one of my source files to remove some functionality. I commented out the input parameter section using comments of the surrounding type - /* --- */

    The Ninja generated code ignored these comments and was giving me an error saying possible missing reference because the TYPE of that input parameter, which was enum, had also been commented out; it was still trying to compile the source including that input parameter.

    When I changed the comments to the // type on each line, the error disappeared.

    Regards,
    Will.

    #2
    Hello Will,

    Thank you for your post.

    Can you provide an example of the code commented out and the lines used for commenting?

    I look forward to your response.

    Comment


      #3
      H Patrick,

      this code causes a problem -

      /*
      [Description("Print volume in the output window (useful for backtesting)")]
      [GridCategory("Parameters")]
      public OutputWindowVolume MAType
      {
      get { return matype; }
      set { matype = value; }
      }
      */

      this code doesnt -

      //[Description("Print volume in the output window (useful for backtesting)")]
      //[GridCategory("Parameters")]
      //public OutputWindowVolume MAType
      //{
      // get { return matype; }
      // set { matype = value; }
      //}

      Comment


        #4
        Hello Will,

        Thank you for your response.

        I tested this on the SampleUniversalMovingAverage and I see the same item, however I was able to isolate it to strictly the brackets '[' and ']' as you can see below:
        Code:
        //		[Description("Choose a Moving Average type.")]
        //		[Category("Parameters")]
        		/*
        		public UniversalMovingAverage MAType
        		{
        			get { return matype; }
        			set { matype = value; }
        		}
        		*/
        This will also compile, why this occurs however is not known to me. This could simply be a C# related item or directly related to NinjaScript. If you have more inquiries on this item please let us know.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by andrewtrades, Today, 04:57 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        3 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        436 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        6 views
        0 likes
        Last Post FAQtrader  
        Started by rocketman7, Today, 09:41 AM
        5 responses
        19 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X