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 rhyminkevin, Today, 04:58 PM
        4 responses
        52 views
        0 likes
        Last Post dp8282
        by dp8282
         
        Started by iceman2018, Today, 05:07 PM
        0 responses
        5 views
        0 likes
        Last Post iceman2018  
        Started by lightsun47, Today, 03:51 PM
        0 responses
        7 views
        0 likes
        Last Post lightsun47  
        Started by 00nevest, Today, 02:27 PM
        1 response
        14 views
        0 likes
        Last Post 00nevest  
        Started by futtrader, 04-21-2024, 01:50 AM
        4 responses
        50 views
        0 likes
        Last Post futtrader  
        Working...
        X