Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Set for the "Values" collection

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

    Set for the "Values" collection

    Hello

    I have created 12 plots on an indicator.
    I am trying to affect each of them a value in a loop but the following instruction is generating an error message at compiling

    Values[n+m][0].set(Values[n+m][1]+ L_Pas[n]);

    CS1061 'type' does not contain a definition for 'member' and no extension method 'name' accepting a first argument of type 'type' could be found (are you missing a using directive or an assembly reference?).

    I understand that where is nothing like a set method for the collection Values

    The reason for the loop is that I don't want to duplicate the code 12 times juste because the name of the final plot is different

    Can anyone see any workaround ?

    Lionel

    #2
    Lionel, have just replied to your email to support as well. Would you see the same issue with a capitalized .Set call?

    Comment


      #3
      Set and not Set

      Thanks for the fast reply, but replacing "set" by "Set" doesn't change anything, same error.

      Lionel

      Comment


        #4
        Lionel, are you sure this would resolve to a double value then as expected by the .Set?

        Values[n+m][1]+ L_Pas[n]

        Would you mind sending me a snippet I could give a run here on my end? You can contact me under the email ticket we had open, if you don't want to post it here.

        Comment


          #5
          I have send you a mail

          Lionel

          Comment


            #6
            Originally posted by Lionel92 View Post
            Hello

            I have created 12 plots on an indicator.
            I am trying to affect each of them a value in a loop but the following instruction is generating an error message at compiling

            Values[n+m][0].set(Values[n+m][1]+ L_Pas[n]);

            CS1061 'type' does not contain a definition for 'member' and no extension method 'name' accepting a first argument of type 'type' could be found (are you missing a using directive or an assembly reference?).

            I understand that where is nothing like a set method for the collection Values

            The reason for the loop is that I don't want to duplicate the code 12 times juste because the name of the final plot is different

            Can anyone see any workaround ?

            Lionel
            Values[n+m][0] is itself a double. You cannot set a double. Try:
            Code:
            [COLOR=red][B]Values[n+m].S[/B][/COLOR]et(Values[n+m][1]+ L_Pas[n]);
            That is, drop the indexer, and capitalize the Set directive.

            Comment


              #7
              many thanks for this reply .

              I am assuming that it will set the current value of the plot "series".

              I don't need it right now but just for my understanding. If we use Values (and not value) we cannot set a bar different from the current bar. Am i correct

              Lionel
              Last edited by Lionel92; 03-28-2013, 08:12 AM.

              Comment


                #8
                Originally posted by Lionel92 View Post
                many thanks for this reply .

                I am assuming that it will set the current value of the plot "series".

                I don't need it right know but just for my understanding. If we use Values (and not value) we cannot set a bar different from the current bar. Am i correct

                Lionel
                As far as I can tell, Values[] is just the DataSeries array that NT uses as the default backing store for Plots. I do not see any reason why you cannot treat the members like any other DataSeries when it comes to setting values.

                Comment


                  #9
                  if i can't use

                  "Values [2][1].Set(something)"

                  how can I access the second bar of the 3rd plot series?

                  Comment


                    #10
                    Originally posted by Lionel92 View Post
                    if i can't use

                    "Values [2][1].Set(something)"

                    how can I access the second bar of the 3rd plot series?
                    Code:
                    Values[2].Set(1, theValueToWhichItIsToBeSet);
                    Which is rather clearly explained when you look in the NT Help at the DataSeries entry.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by argusthome, 03-08-2026, 10:06 AM
                    0 responses
                    88 views
                    0 likes
                    Last Post argusthome  
                    Started by NabilKhattabi, 03-06-2026, 11:18 AM
                    0 responses
                    48 views
                    0 likes
                    Last Post NabilKhattabi  
                    Started by Deep42, 03-06-2026, 12:28 AM
                    0 responses
                    30 views
                    0 likes
                    Last Post Deep42
                    by Deep42
                     
                    Started by TheRealMorford, 03-05-2026, 06:15 PM
                    0 responses
                    34 views
                    0 likes
                    Last Post TheRealMorford  
                    Started by Mindset, 02-28-2026, 06:16 AM
                    0 responses
                    68 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Working...
                    X