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

Conditional compiling for 32/64 bits

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

    Conditional compiling for 32/64 bits

    Dear experts!
    I can see from different posts that preprocessor directives can be used in NT8 indicators. Is it possible to make conditional compiling depending of 32/64 bits platform?
    Something similar to the below part of the code:
    Code:
    [StructLayout(LayoutKind.Explicit,Size = 12)]
    	public struct My Data
    		{
    		 FieldOffset(0)]	public	int			iCode;		 		
    		 FieldOffset(4)]	public	IntPtr			szName;
    	#if NT8_32 									
    		 FieldOffset(8)]	public	int			iReserved;
    	#endif
    		}
    If answer is “yes”, what could be the directive in #if statement. If answer is "no" any suggestion about the ways to achieve similar result

    Thank you in advance
    GmA

    #2
    Hello gma17,

    Thanks for opening the thread.

    There are not any supported preprocessor directives that I know of that can identify a 64bit compile from a 32bit compile.

    I could submit a feature request on your behalf to request to have supported preprocessor directives for 32 bit and 64 bit compiles if it interests you.

    If that is the case, please let me know.
    JimNinjaTrader Customer Service

    Comment


      #3
      Helo Jim!

      Thank you for the fast reply.
      Well, It could be a good feature in the future, but I'll need to find another solution.

      With kind regards
      GmA

      Comment


        #4
        Hello gma17,

        As a thought, you could place this in a separate namespace and include that namespace depending on the version of the script you are working on. This wouldn't be as 'seamless' as having the code indeffed, but it could lead you in a way where you can cleanly separate code from different versions of the script.

        Our colleague Chelsea has posted an example of how an AddOn can be used for general use methods and variables.

        Chelsea's example for NT8 - http://ninjatrader.com/support/forum...104#post457104
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ZenCortexCLICK, Today, 04:58 AM
        0 responses
        5 views
        0 likes
        Last Post ZenCortexCLICK  
        Started by sidlercom80, 10-28-2023, 08:49 AM
        172 responses
        2,280 views
        0 likes
        Last Post sidlercom80  
        Started by Irukandji, Yesterday, 02:53 AM
        2 responses
        17 views
        0 likes
        Last Post Irukandji  
        Started by adeelshahzad, Today, 03:54 AM
        0 responses
        7 views
        0 likes
        Last Post adeelshahzad  
        Started by Barry Milan, Yesterday, 10:35 PM
        3 responses
        13 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X