Line changing whitespace characters are not all the same which can cause some problems. Sometimes Words() can be clean option for something like this
Names Default To Here(1);
nw = New Window("This is a script box",
H List Box(
Panel Box("Long Script",
sb1 = Script Box(
"print(\!" Hello\!");
print(\!" Hello\!");
print(\!" Hello\!");
// comment
print(\!" Hello\!");
// comment
print(\!" Hello\!");",
600,
500
);
),
sb2 = Script Box(, 600, 500)
)
);
// You can also clear tabs if you wish to \t (regex) or \!t (jmp)
Wait(1);
sb2 << Set Text(Regex(sb1 << get text, "[\r\n]+", "\!N", GLOBALREPLACE));
sb2 << reformat;
Wait(1);
sb2 << Set Text("");
Wait(1);
sb2 << Set Text(Concat Items(Words(sb1 << get text, "\!N"), "\!N"));
sb2 << reformat;
Wait(1);
sb2 << Set Text("");
Wait(1);
lines = sb1 << get lines;
empty = Loc(ls, "");
sb2 << Set Text(Concat Items(Remove(lines, As List(empty)), "\!N"));
sb2 << reformat;
In JMP
JSL Syntax Rules (jmp.com)
In regex (usually)
-Jarmo