HISE Logo Forum
    • Categories
    • Register
    • Login

    SNEX UI Parameters

    Scheduled Pinned Locked Moved ScriptNode
    12 Posts 4 Posters 670 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Christoph HartC
      Christoph Hart @Straticah
      last edited by

      @Straticah I‘m afraid you need a basic understanding of C++ in order to write C++ code :)

      In your example you‘re redeclaring a variable within the same scope.

      tobanteT 1 Reply Last reply Reply Quote 0
      • tobanteT
        tobante @Christoph Hart
        last edited by

        @Christoph-Hart Which variable is redeclared? I don't see it? He has scopes around each parameter.

        Christoph HartC 1 Reply Last reply Reply Quote 0
        • Christoph HartC
          Christoph Hart @tobante
          last edited by

          @tobante scriptnode::parameter p, line 69

          tobanteT 1 Reply Last reply Reply Quote 0
          • tobanteT
            tobante @Christoph Hart
            last edited by

            @Christoph-Hart

            But this is legal:

            {
                // scope a
                int p = 42;
                // ...
            }
            {
                // scope b
                int p = 43;
                // ...
            }
            Christoph HartC 1 Reply Last reply Reply Quote 0
            • Christoph HartC
              Christoph Hart @tobante
              last edited by

              @tobante Yes but this isn't:

              int p = 41;
              {
              
              }
              int p = 42;
              
              tobanteT 2 Replies Last reply Reply Quote 0
              • tobanteT
                tobante @Christoph Hart
                last edited by

                @Christoph-Hart I'm still confused.

                • Function: L59 -L75 (contains 2 nested scopes)
                • Scope A: L60 -L65 (contains 1st p)
                • Scope B: L68 -L74 (contains 2nd p)

                Indentation is a little misleading, but it is valid.

                1 Reply Last reply Reply Quote 0
                • tobanteT
                  tobante @Christoph Hart
                  last edited by

                  @Christoph-Hart I agree that your example is invalid, but that's not what @Straticah has in his example. The error probably is that he uses d for the parameter he called data. Not sure why the compiler flags line 58. Maybe it's always beginning of function.

                  Christoph HartC 1 Reply Last reply Reply Quote 0
                  • Christoph HartC
                    Christoph Hart @tobante
                    last edited by

                    @tobante 1b1f11d4-31ad-4d58-8b81-c3b3b250d3da-image.png

                    Christoph HartC 1 Reply Last reply Reply Quote 0
                    • Christoph HartC
                      Christoph Hart @Christoph Hart
                      last edited by

                      haha, now I see it too. That is a contender for worst code formatting ever...

                      tobanteT 1 Reply Last reply Reply Quote 1
                      • tobanteT
                        tobante @Christoph Hart
                        last edited by

                        @Christoph-Hart I was so confused, because I gave @Straticah the code from your GitHub repo. :)

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        21

                        Online

                        1.7k

                        Users

                        11.9k

                        Topics

                        103.3k

                        Posts