• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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.

    http://msdn.microsoft.com/en-us/library/e6w8fe1b.aspx

    public const string MyConstString = "aaaaaaaaaaaaaaaaaaaaaaaa";

    If your asking something else let me know.
    BrettNinjaTrader Product Management

    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: http://www.ninjatrader.com/support/f...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 bosajin, Today, 06:27 PM
        0 responses
        2 views
        0 likes
        Last Post bosajin
        by bosajin
         
        Started by saltminer, Today, 06:11 PM
        0 responses
        2 views
        0 likes
        Last Post saltminer  
        Started by epitoma, Today, 05:21 PM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_ShawnB  
        Started by BatBart, Today, 01:24 PM
        1 response
        23 views
        0 likes
        Last Post NinjaTrader_Melissa  
        Started by ezrakoper, Today, 03:05 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X