How to use "MemoryBlock::operator[]"

Home Forums General Programming How to use "MemoryBlock::operator[]"

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #14596
    GunniKonn
    Participant
      • Topics: 5
      • Replies: 27
      • Total: 32

      According to the JUCE documentation this can be used to return a byte from the memory block, and that it returns a reference.
      What I want to do is to calculate a checksum by adding all the bytes I have within my MemoryBlock, so I wonder if I can get a hint on how to implement/use it. I have already succeeded in addressing the MemoryBlockbytes by bit number, and this way I can write and read bits using the setBitRange and getBitRange, but I would love to hear about this one.

      • This topic was modified 10 years, 6 months ago by GunniKonn.
      #14603
      atom
      Keymaster
        • Topics: 159
        • Replies: 2945
        • Total: 3104
        • ★★★★★

        This operator is not available in Lua, you need to use function calls getSize() and getByte() in a “for” loop.

        #14606
        GunniKonn
        Participant
          • Topics: 5
          • Replies: 27
          • Total: 32

          Thanks for the hint, I had seen and played with the getSize() but I have no idea how I overlooked getByte(), I will examine it now.

        Viewing 3 posts - 1 through 3 (of 3 total)
        • The forum ‘Programming’ is closed to new topics and replies.
        There is currently 0 users and 84 guests online
        No users are currently active
        Forum Statistics
        Threads: 2,495, Posts: 17,374, Members: 77,605
        Most users ever online was 12 on January 22, 2019 3:47 pm
        Ctrlr