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 funk10101, Today, 12:02 AM
        0 responses
        3 views
        0 likes
        Last Post funk10101  
        Started by gravdigaz6, Yesterday, 11:40 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by MarianApalaghiei, Yesterday, 10:49 PM
        3 responses
        10 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by XXtrader, Yesterday, 11:30 PM
        0 responses
        4 views
        0 likes
        Last Post XXtrader  
        Started by love2code2trade, 04-17-2024, 01:45 PM
        4 responses
        28 views
        0 likes
        Last Post love2code2trade  
        Working...
        X