Line break with .asCompileString

hi there -

i’m having a little trouble finding information on this. i have a fairly long array that i’d like to post all of…so i’m using .asCompileString. i’m hoping to add line breaks. i’ve created some smaller arrays here to demonstrate what happens.

(
w = Window("", Rect(0, 0, 500 ,500));
a = [0, 1, 2, 3, 4, 9] ++ "\n" ++ [2, 3, 4, 2, 1, 2 ,3];
s = StaticText(w, Rect(90, 90, 100, 100)).string_(a.asCompileString);
w.front;
)

is there another approach to this that i’m unaware of? thanks.

I think it’s just some missing brackets around the line break string. This seems to work:

(
w = Window("", Rect(0, 0, 500 ,500));
a = [0, 1, 2, 3, 4, 9] ++ ["\n"] ++ [2, 3, 4, 2, 1, 2 ,3];
s = StaticText(w, Rect(90, 90, 100, 100)).string_(a.asCompileString);
w.front;
)

Maybe without the brackets the string is treated as an array of separate characters (which it is)?

Best,
Paul

1 Like