Shop OBEX P1 Docs P2 Docs Learn Events
Variables — Parallax Forums

Variables

codekingcodeking Posts: 39
edited 2007-01-08 22:26 in Propeller 1
Let's say you have the file main.spin, and 1.spin and 2.spin linked to it. Your file tree would look something like this:

main.spin
|- 1.spin
|- 2.spin

Could 2.spin access variables from 1.spin? Could main.spin access variables from 1- or 2.spin?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-01-08 22:18
    No. A spin object (.spin file) can only access named constants and public methods in other objects. You could define methods in 2.spin that would make certain variables accessible to the outside. These methods could be accessed in main.spin and 1.spin.
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-01-08 22:26
    like in the mouse object:

    PUB abs_x : x
    
    '' Get absolute-x
    
      x := par_x
    
    
Sign In or Register to comment.