Shop OBEX P1 Docs P2 Docs Learn Events
Child to Child VAR pointers — Parallax Forums

Child to Child VAR pointers

DynamoBenDynamoBen Posts: 366
edited 2013-01-08 10:13 in Propeller 1
So in Spin (not PASM) I can share VAR pointers between parent -> child and child <- parent. What I'm wondering is if you can share between child <-> child? So in this case the parent would gather pointers from each child and then share them with each other.

Comments

  • Dave HeinDave Hein Posts: 6,347
    edited 2013-01-08 09:55
    Yes, each instance of an object has its own dedicated VAR space. So it is possible for objects to return pointers to VAR variables to upper objects, which could then pass them on to other objects.
  • DynamoBenDynamoBen Posts: 366
    edited 2013-01-08 10:00
    Dave Hein wrote: »
    Yes, each instance of an object has its own dedicated VAR space. So it is possible for objects to return pointers to VAR variables to upper objects, which could then pass them on to other objects.

    Hmmm if that is the case I need to dig into my code more. I have a child object that is trying to write to another child objects buffer, it's not working and I suspect I've missed something. Thanks for the confirmation!
  • DynamoBenDynamoBen Posts: 366
    edited 2013-01-08 10:13
    I think I may have found my issue in code. I forgot an @ in the bytemove line to transfer data to the other child.
Sign In or Register to comment.