Shop OBEX P1 Docs P2 Docs Learn Events
Splitting commands in multiple lines? — Parallax Forums

Splitting commands in multiple lines?

yousefyousef Posts: 21
edited 2012-11-16 16:21 in Propeller 1
How to split a command into two lines if it was too long? for example:

s1:= Lookupz(i: 0, 1, 2, 3, 4, 5, 6, 7 ,
8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39,
40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63 )

if i wrote this the compiler will give me an error, is there a way to do this?

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2012-11-16 16:12
    You can use comment blocks to cross the line break, e.g.
    s1:= Lookupz(i: 0, 1, 2, 3, 4, 5, 6, 7 ,[COLOR="#FF0000"]{[/COLOR]
    [COLOR="#FF0000"]}[/COLOR]56, 57, 58, 59, 60, 61, 62, 63 )
    
    In your particular case you could simply use a range though, s1 := Lookupz(i: 0..63) or in fact s1 := i (provided i never goes out of range).
  • yousefyousef Posts: 21
    edited 2012-11-16 16:21
    nice trick
Sign In or Register to comment.