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

is there a way to define a constant to be a string of repeated characters

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

    is there a way to define a constant to be a string of repeated characters

    is there a way to define a constant to be a character repeated 20 times,
    which might look something like the following?

    public string NewVariable( " ",20);

    #2
    Hello,

    Yes simply by adding the const keyword it then could not be changed.However you would need to set it manually be be the 20 charactors.



    public const string MyConstString = "aaaaaaaaaaaaaaaaaaaaaaaa";

    If your asking something else let me know.

    Comment


      #3
      Originally posted by joemiller View Post
      is there a way to define a constant to be a character repeated 20 times,
      which might look something like the following?

      public string NewVariable( " ",20);
      Joe,

      You asked this very question some time back, at which time I gave you this response.

      ref: https://www.ninjatrader.com/support/...d.php?p=335725

      IOW, yes you can.

      Comment


        #4
        thanks brett and koganam.

        yea, I know, it's embarrassing how I forget something you told me june22, only six months ago. can't blame it on my 82 years because I have been that way all my life. I was introduced to programming 3 or so years ago and am now aware that possibly my brain may not be wired for serious programming. however, doesn't matter ... i persist because I love the power of software and the internet and actually enjoy doing this. drive defensively because you are a good resource and i would hate to lose you.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by f.saeidi, Today, 11:02 AM
        0 responses
        0 views
        0 likes
        Last Post f.saeidi  
        Started by geotrades1, Today, 10:02 AM
        3 responses
        10 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by rajendrasubedi2023, Today, 09:50 AM
        3 responses
        15 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by lorem, Today, 09:18 AM
        2 responses
        11 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by geddyisodin, Today, 05:20 AM
        4 responses
        30 views
        0 likes
        Last Post geddyisodin  
        Working...
        X