Shop OBEX P1 Docs P2 Docs Learn Events
Parameter/property inheritance — Parallax Forums

Parameter/property inheritance

pacmanpacman Posts: 327
edited 2009-03-29 05:10 in Propeller 1
If I had an object {lets call it Fred} that is of type BigObject, but BigObject uses another object {FullDuplexSerial} how can I make the Start/stop/etc parameters of FullDuplexSerial inherited by bigObject?

Rather than have my own 'start' procedure in BigObject (that just calls the start parameter of FullDuplexSerial and directly passes the inputs), I could then just call "Fred.Start (12,13,0,9600)" for example.


Thanks in advance

Paul

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-29 05:09
    You can't. Spin is not a complete object oriented language. In fact, its object orientation is quite limited. Only method names and named constants are inherited and inheritance only goes out one level.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-03-29 05:10
    Inheritance as you describe it is not implemented in Spin. Your object's start method will have to call the one in FullDuplexSerial explicitly.

    -Phil
Sign In or Register to comment.