Shop OBEX P1 Docs P2 Docs Learn Events
"WITH" statement request — Parallax Forums

"WITH" statement request

hippyhippy Posts: 1,981
edited 2007-11-03 16:08 in Propeller 1
Can we please have a WITH statement for dealing with object handles as Microsoft Visual Basic does, for precisely the same reason Visual Basic had it ?

It's much more elegant, clearer, and less to type to have -

PUB EchoLoop
  repeat
    with mySerialObject
      .txByte( .rxByte )




than

PUB EchoLoop
  repeat
     mySerialObject.txByte( mySerialObject.rxByte )




I usually end up creating PRI routines for TxByte and RxByte for clarity and ease of use which then call the specific object's method, but that adds an extra layer of overhead which I don't particularly want.

Comments

  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-11-03 16:08
    Hippy - nice Idea ..

    Rgds,
    John

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'
Sign In or Register to comment.