Shop OBEX P1 Docs P2 Docs Learn Events
Multiple instructions on same line in Spin — Parallax Forums

Multiple instructions on same line in Spin

EMHmark7EMHmark7 Posts: 93
edited 2014-05-14 13:43 in General Discussion
Hi,

Using Spin language for Propeller, is there a delimiter that allows putting multiple instructions on the same line?

Thanks

Comments

  • Heater.Heater. Posts: 21,230
    edited 2014-04-18 07:19
    No. Why do you need to do so?
  • EMHmark7EMHmark7 Posts: 93
    edited 2014-04-18 07:53
    To make shorter listings, sharper listings for things related, and to write debugging/monitoring code beside the application logic, so easier to see the essential.
  • JonnyMacJonnyMac Posts: 9,107
    edited 2014-04-18 13:04
    Interesting. Many programmers consider one instruction per line to be the key to those attributes.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-18 13:22
    Seems we have a world that is split between those who like lists all in a row, and those that like lists all in a column.

    I see that C lists allow the 'in a row' approach, but I have to scroll sideways - left and right - as well as up and down to read.
    I prefer to only have to scroll up and down. Zooming doesn't work as the font gets too tiny to read.

    I suppose you could have Spin code accept both ways by inserting a special character in between as punctuation.

    Why not use Simple IDE and just code in GCC? That seems to be the style you desire.

    SPIN does some other unique things for notation and documentation. Curly brackets and double curly brackets and windows that show more or less comments.
  • EMHmark7EMHmark7 Posts: 93
    edited 2014-05-14 13:38
    My project is almost finish. I like writing in same line when things are not making a long line but put together several things that are logically related and shorten the amount of lines, such as 2-3 variables for initializing something, etc. But the SPIN ability to structure blocks according to indentation reduces lines and makes it more human intuitive text,

    If we change indentation and some lines are left as is, it changes the logic

    and there is not way that I know of to know what was the indentation before beginning to change it. Neither I know a way to change indentation of several lines together.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-05-14 13:40
    EMHmark7 wrote:
    Neither I know a way to change indentation of several lines together.
    Select the lines you want to indent and hit Tab (or shift-Tab to unindent them).

    -Phil
  • EMHmark7EMHmark7 Posts: 93
    edited 2014-05-14 13:43
    OK, so it greatly reduces possible unwanted side effects of that feature. Thanks for the tip!
Sign In or Register to comment.