Shop OBEX P1 Docs P2 Docs Learn Events
Break a long code line — Parallax Forums

Break a long code line

ArchiverArchiver Posts: 46,084
edited 2002-05-29 00:37 in General Discussion
Can't seem to find the answer. Is is possible to break a long line of
code into two or more lines? A good example is a BRANCH statement
with 15 possible routes.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-05-29 00:37
    I, too, sometimes find it necessary to break BRANCH statements into multiple
    lines. The key is adjusting the index variable for the multiple lines.

    Like this:

    BRANCH idx, [noparse][[/noparse]Task0, Task1, Task2, Task3, Task4]
    idx = idx - 5
    BRANCH idx, [noparse][[/noparse]Task5, Task6, Task7, Task8, Task9]
    idx = idx - 5
    BRANCH idx, [noparse][[/noparse]Task10, Task11, Task12, Task13, Task14]

    This works because BRANCH will drop through if the index value is greater
    than the number of target addresses.

    -- Jon Williams
    -- Parallax


    In a message dated 5/28/02 4:44:10 PM Central Daylight Time,
    gene_rozea@p... writes:


    > Can't seem to find the answer. Is is possible to break a long line of
    > code into two or more lines? A good example is a BRANCH statement
    > with 15 possible routes.
    >




    [noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.