HISE Logo Forum
    • Categories
    • Register
    • Login

    ARRAY || Get index value??

    Scheduled Pinned Locked Moved General Questions
    8 Posts 3 Posters 56 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.
    • ChazroxC
      Chazrox
      last edited by Chazrox

      How do I get a value of an index in an array? Is that even possible?

      I just realized I could use a hidden slider for values but is what I asked possible?

      ustkU d.healeyD 2 Replies Last reply Reply Quote 0
      • ustkU
        ustk @Chazrox
        last edited by

        @Chazrox myArray[index]

        Can't help pressing F5 in the forum...

        1 Reply Last reply Reply Quote 2
        • d.healeyD
          d.healey @Chazrox
          last edited by

          @Chazrox

          const myArray = [10, 20, 30, 40, 50];
          
          Console.print(myArray.indexOf(20)); // 1
          Console.print(myArray[2]); // 30
          Console.print(myArray.contains(50)); // true
          

          Looks like Greg got there first :)

          Libre Wave - Freedom respecting instruments and effects
          My Patreon - HISE tutorials
          YouTube Channel - Public HISE tutorials

          ChazroxC ustkU 3 Replies Last reply Reply Quote 1
          • ChazroxC
            Chazrox @d.healey
            last edited by

            @d-healey @ustk Thanks! Both of you! lol

            1 Reply Last reply Reply Quote 0
            • ustkU
              ustk @d.healey
              last edited by ustk

              @d-healey said in ARRAY || Get index value??:

              Looks like Greg got there first :)

              true, but with no comparable answer 😉

              Can't help pressing F5 in the forum...

              1 Reply Last reply Reply Quote 1
              • ChazroxC
                Chazrox @d.healey
                last edited by

                @d-healey How would you go about changing a value of a given index based on a combobox value?

                in your example,
                How would I change myArray[1] = 20 to myArray[1] = 32?

                d.healeyD 1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey @Chazrox
                  last edited by

                  @Chazrox said in ARRAY || Get index value??:

                  myArray[1] = 20 to myArray[1] = 32

                  Like that

                  Libre Wave - Freedom respecting instruments and effects
                  My Patreon - HISE tutorials
                  YouTube Channel - Public HISE tutorials

                  ChazroxC 1 Reply Last reply Reply Quote 1
                  • ChazroxC
                    Chazrox @d.healey
                    last edited by

                    @d-healey lol !!

                    ok so you have to see this then....

                    its on a different thread....
                    https://forum.hise.audio/topic/12880/chord-player-inversions-help-with-indexing

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

                    20

                    Online

                    1.8k

                    Users

                    11.9k

                    Topics

                    103.9k

                    Posts