Shop OBEX P1 Docs P2 Docs Learn Events
Passing pointers between objects in SPIN — Parallax Forums

Passing pointers between objects in SPIN

EliEli Posts: 3
edited 2008-01-05 02:47 in Propeller 1
Hello all,


I am having a problem passing pointers from one object to another in SPIN. When I print from the pointer location inside the home object, the correct information is printed, but when I pass the pointer value to another object and try to print from there, I get something completely different. Both pointer values are identical, so my guess is that the information that the pointer is pointing to is overwritten then the·object call is made. Any·ideas?

--Eli

Comments

  • deSilvadeSilva Posts: 2,967
    edited 2008-01-04 19:48
    If it be so, then it would be you who had overwritten it..
    Much can depend on what you mean by "printing" and how it is done...
    Can you post your code?

    Post Edited (deSilva) : 1/5/2008 2:47:15 AM GMT
  • DgswanerDgswaner Posts: 795
    edited 2008-01-05 01:05
    what he mean to say was, welcome to the forum and if you post code it makes it easier to know how to help you.

    are you referring to passing values to an object?

    if so:

    main file

    someobject.task(variable) 'calls the object and passes the variable


    OBJECT FILE

    pub task(variable)
    add code here


    you'll of coarse have to add the variable call outs and such to each file. hope that make sense.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster

    DGSwaner

    Post Edited (Dgswaner) : 1/5/2008 1:16:30 AM GMT
  • deSilvadeSilva Posts: 2,967
    edited 2008-01-05 02:47
    Dgswaner said...
    what he mean to say was, welcome to the forum and if you post code it makes it easier to know how to help you.
    Yes, Dogswaner, I shall keep that in mind. smile.gif
Sign In or Register to comment.