Shop OBEX P1 Docs P2 Docs Learn Events
splitting long lines of code — Parallax Forums

splitting long lines of code

ArchiverArchiver Posts: 46,084
edited 2001-03-29 02:13 in General Discussion
I have a long line of code that I'd like to split into two (or more) lines
for readability. Is there any way to do this?

Here is a snippet of pseudocode:

*snip*

Serout 1, 16468, [noparse][[/noparse]"blah blah blah blah
blah blah blah"]

*snip*

Thanks,
--Craig

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-03-26 06:41
    At 3/25/2001 Sunday 11:36 PM, Craig Lefkowitz promulgated:
    >I have a long line of code that I'd like to split into two (or more) lines
    >for readability. Is there any way to do this?
    >
    >Here is a snippet of pseudocode:
    >
    >*snip*
    >
    >Serout 1, 16468, [noparse][[/noparse]"blah blah blah blah
    >blah blah blah"]
    >
    >*snip*
    >
    >Thanks,
    >--Craig
    >
    >Craig -

    Just string it out in one line as long as you need to.
    There is no continuation character in PBASIC.

    Bruce
  • ArchiverArchiver Posts: 46,084
    edited 2001-03-26 12:38
    >At 3/25/2001 Sunday 11:36 PM, Craig Lefkowitz promulgated:
    >>I have a long line of code that I'd like to split into two (or more) lines
    >>for readability. Is there any way to do this?
    >>
    <SNIP>

    If the only reason for breaking it is readability, why not add the broken
    line as a comment:

    ' Serout 1, 16468, [noparse][[/noparse]"blah blah blah blah
    ' blah blah blah"]
  • ArchiverArchiver Posts: 46,084
    edited 2001-03-28 23:00
    But if I comment it, it wont compile, right?
    (and I may even get errors because the quotes and brackets aren't closed).

    Perhaps an enhancement to future versions of the compiler would be to add a
    continuation character (e.g. the _ in VB)?


    Original Message
    From: carl@g... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=IK5gLQsCTp-LJRsET6rEP_gBohYMxnLMj8JAUhUS7oOSmZzqn0Z6DLs51an8aJps5rPX]carl@g...[/url
    Sent: Monday, March 26, 2001 6:39 AM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] splitting long lines of code


    >At 3/25/2001 Sunday 11:36 PM, Craig Lefkowitz promulgated:
    >>I have a long line of code that I'd like to split into two (or more) lines
    >>for readability. Is there any way to do this?
    >>
    <SNIP>

    If the only reason for breaking it is readability, why not add the broken
    line as a comment:

    ' Serout 1, 16468, [noparse][[/noparse]"blah blah blah blah
    ' blah blah blah"]




    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-03-29 01:59
    [font=arial,helvetica]Why not use two SEROUT lines? ·It will work and the code will be easy to read.

    ·SEROUT 1, 16468, [noparse][[/noparse]"blah blah blah blah"]
    ·SEROUT 1, 16468, [noparse][[/noparse]"blah blah blah"]

    Sorry if I'm stating the obvious....

    -- Jon Williams


    In a message dated 3/28/01 4:08:13 PM Central Standard Time,
    craig.lefkowitz@mindspring.com writes:


    But if I comment it, it wont compile, right?
    (and I may even get errors because the quotes and brackets aren't closed).

    Perhaps an enhancement to future versions of the compiler would be to add a
    continuation character (e.g. the _ in VB)?


    Original Message
    From: carl@gwis.com [noparse][[/noparse]mailto:carl@gwis.com]
    Sent: Monday, March 26, 2001 6:39 AM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] splitting long lines of code


    >At 3/25/2001 Sunday 11:36 PM, Craig Lefkowitz promulgated:
    >>I have a long line of code that I'd like to split into two (or more) lines
    >>for readability. ·Is there any way to do this?
    >>
    <SNIP>

    If the only reason for breaking it is readability, why not add the broken
    line as a comment:

    ' Serout 1, 16468, [noparse][[/noparse]"blah blah blah blah
    ' blah blah blah"]





    [/font]
  • ArchiverArchiver Posts: 46,084
    edited 2001-03-29 02:13
    Duh!· I can't believe I missed that.· Might add a few microseconds, but I think I could spare it in favor of readable code.·

    Good idea.· Thanks.·

    --Craig

    Original Message
    From: jonwms@aol.com [noparse][[/noparse]mailto:jonwms@aol.com]
    Sent: Wednesday, March 28, 2001 8:00 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] splitting long lines of code

    [font=arial,helvetica]Why not use two SEROUT lines? ·It will work and the code will be easy to read.

    ·SEROUT 1, 16468, [noparse][[/noparse]"blah blah blah blah"]
    ·SEROUT 1, 16468, [noparse][[/noparse]"blah blah blah"]

    Sorry if I'm stating the obvious....

    -- Jon Williams


    In a message dated 3/28/01 4:08:13 PM Central Standard Time,
    craig.lefkowitz@mindspring.com writes:


    But if I comment it, it wont compile, right?
    (and I may even get errors because the quotes and brackets aren't closed).

    Perhaps an enhancement to future versions of the compiler would be to add a
    continuation character (e.g. the _ in VB)?


    Original Message
    From: carl@gwis.com [noparse][[/noparse]mailto:carl@gwis.com]
    Sent: Monday, March 26, 2001 6:39 AM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] splitting long lines of code


    >At 3/25/2001 Sunday 11:36 PM, Craig Lefkowitz promulgated:
    >>I have a long line of code that I'd like to split into two (or more) lines
    >>for readability. ·Is there any way to do this?
    >>
    <SNIP>

    If the only reason for breaking it is readability, why not add the broken
    line as a comment:

    ' Serout 1, 16468, [noparse][[/noparse]"blah blah blah blah
    ' blah blah blah"]






    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

    [/font]
Sign In or Register to comment.