Are they possible? I'm trying to make a terminal OS in Scratch, and I need this for the output buffer.
Offline
Scratch doesn't natively support escaping newline characters (\n), though if you output to a list, you could take a string and add newlines to the output yourself, roughly like this:
when gf clicked delete [all] of [Terminal v] //list that the user will see set [String v] to [dunno if this works,\nyou go figure.] //our string, with a escaped newline that we'll check for set [i v] to [1] //iterator set [output v] to [] //string that will be added to the list repeat until <(i) > (length of (String))> if <(letter (i) of (String)) = [\]> //check for escape character if <(letter ((i) + [1]) of (String)) = [n]> //is it a newline? add (output) to [Terminal v] //add our string so far to the Terminal. It could be empty. set [output v] to [] //reset output string change [i v] by [2] //skip the newline character; next letter end else set [output v] to (join (output) (letter (i) of (String))) //add current letter to output string change [i v] by [1] //next letter end end if <not <(output) = []>> //if output string is not empty (i.e. newline at the very end) add (output) to [Terminal v] end
Offline