hyperPad hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    Box Container Pointing at Get Array Value @ Index # Updates?

    Scheduled Pinned Locked Moved
    Help and Support
    2
    3
    102
    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.
    • D
      Deeeds
      last edited by

      If a Box Container's storage is the output of a Get Array Value at Index Behaviour, and somewhere else, on an object somewhere else, the value stored at that index in that array is changed, does the Box Container update itself with this new value?

      1 Reply Last reply Reply Quote 0
      • HamedH
        Hamed Admin
        last edited by

        In programming terms, the box container will point at the get array value. The get array needs to be triggered again to update the box container.

        D 1 Reply Last reply Reply Quote 0
        • D
          Deeeds @Hamed
          last edited by Deeeds

          @Hamed Got it. Thank you!

          So the Get Array Value at Index Behaviour is creating a locally stored variable/pointer of whatever its lookup (get) from the array returns, for the use of local Box Containers, Value Behaviours and any other localised behaviours wanting to use it. I think.

          For anyone coming along in the future, this seems to be what's happening, in pseudo code (please correct me if I'm wrong, @Hamed), wherein * indicates a pointer.

          *myLookUplocalStorage = myArray[atIndex]
          myBoxContainer = *myLookUPlocalStorage
          
          myArray[atIndex] += 1
          
          // myArray[atIndex] is now 1 bigger , but neither localStorage nor myBoxContainer know anything about this update
          

          myBoxContainer stores a pointer to the localised lookup (get), so whatever changes at that address is instantly reflected in myBoxContainer

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