Discuss Scratch

bsteichman
Scratcher
500+ posts

multi line say blocks

What I am proposing is not a new block, but a modification to the existing say block. add a function for new lines!

right now we have the regular one-liner:

but what if we could do multiple lines in the say block?

(sorry for crude photoshop)

One option for this would be to do \n like every other programming language but I can see why that would be confusing, so why don't we just
have a reporter block that just returns enter?
(⏎ :: operators) //returns a new line
so the use of it would look something like this:
say (join (join [Hello] (⏎  :: operators)  ) [There!])

If rewriting scratch to support new lines is too difficult (EX: lists), and it's only easy to do with say blocks, just have the symbol show up
“Hello⏎There!”

to be honest you don't even have to code the enter operator block, just have it do a new line when the string put into the say block has “⏎”
starlightsparker
Scratcher
1000+ posts

multi line say blocks

bsteichman wrote:

say (join (join [Hello] (⏎  :: operators)  ) [There!])
I feel that’s too much work just for another line - not for ST, for users.
Can’t it just be that you can type the return key
like
this
And then it shows up as another another line, and if you don’t use the return key it’s one line?

Last edited by starlightsparker (Aug. 29, 2024 00:11:57)

blubby4
Scratcher
100+ posts

multi line say blocks

You can do this already! Just put your cursor to the right of this bracket: [
], then press shift+right arrow, then copy. now you can paste it into the string, or into a variable, and it will work with the say block.
starlightsparker
Scratcher
1000+ posts

multi line say blocks

blubby4 wrote:

You can do this already! Just put your cursor to the right of this bracket: [
], then press shift+right arrow, then copy. now you can paste it into the string, or into a variable, and it will work with the say block.
And for mobile?
blubby4
Scratcher
100+ posts

multi line say blocks

starlightsparker wrote:

blubby4 wrote:

You can do this already! Just put your cursor to the right of this bracket: [
], then press shift+right arrow, then copy. now you can paste it into the string, or into a variable, and it will work with the say block.
And for mobile?
IDK, maybe backpack it? does mobile have a backpack?
bsteichman
Scratcher
500+ posts

multi line say blocks

blubby4 wrote:

You can do this already! Just put your cursor to the right of this bracket: [
], then press shift+right arrow, then copy. now you can paste it into the string, or into a variable, and it will work with the say block.
i copied it, doesn't work.
bsteichman
Scratcher
500+ posts

multi line say blocks

starlightsparker wrote:

bsteichman wrote:

say (join (join [Hello] (⏎  :: operators)  ) [There!])
I feel that’s too much work just for another line - not for ST, for users.
Can’t it just be that you can type the return key
like
this
And then it shows up as another another line, and if you don’t use the return key it’s one line?
“to be honest you don't even have to code the enter operator block, just have it do a new line when the string put into the say block has “⏎””

mb if it wasn't clear enough

Last edited by bsteichman (Aug. 29, 2024 02:41:56)

A-MARIO-PLAYER
Scratcher
1000+ posts

multi line say blocks

We could just allow newlines in strings, like this:
say [multi
line]

Yeah i cant recreate this in Scratchblocks.

Last edited by A-MARIO-PLAYER (Aug. 29, 2024 12:27:17)

medians
Scratcher
1000+ posts

multi line say blocks

starlightsparker wrote:

blubby4 wrote:

You can do this already! Just put your cursor to the right of this bracket: [
], then press shift+right arrow, then copy. now you can paste it into the string, or into a variable, and it will work with the say block.
And for mobile?
Why can't mobile copy and paste a character?
starlightsparker
Scratcher
1000+ posts

multi line say blocks

medians wrote:

starlightsparker wrote:

blubby4 wrote:

You can do this already! Just put your cursor to the right of this bracket: [
], then press shift+right arrow, then copy. now you can paste it into the string, or into a variable, and it will work with the say block.
And for mobile?
Why can't mobile copy and paste a character?
Maybe I’m not understanding- Which character?
EmmettVA
Scratcher
5 posts

multi line say blocks

I don't care what other people say, this is a good idea.
blubby4
Scratcher
100+ posts

multi line say blocks

starlightsparker wrote:

medians wrote:

starlightsparker wrote:

blubby4 wrote:

You can do this already! Just put your cursor to the right of this bracket: [
], then press shift+right arrow, then copy. now you can paste it into the string, or into a variable, and it will work with the say block.
And for mobile?
Why can't mobile copy and paste a character?
Maybe I’m not understanding- Which character?
Maybe it didn't work in the forums, but if you search for line feed character copy paste, you should be able to copy it.
8to16
Scratcher
1000+ posts

multi line say blocks

You can do this with hacked blocks
here's an example:https://scratch.mit.edu/projects/1076436111/
ThisIsTemp1
Scratcher
1000+ posts

multi line say blocks

It should instead be determined by this:

say [Hello/There!]

With an escape function using brackets.

Last edited by ThisIsTemp1 (Oct. 3, 2024 16:44:16)

mysinginmonsters
Scratcher
100+ posts

multi line say blocks

ThisIsTemp1 wrote:

It should instead be determined by this:

say [Hello/There!]

With an escape function using brackets.
The escape sequence needs something following it. But this isn't a good idea since it could cause new programmers to get confused on why they can't type a backslash.

blubby4 wrote:

You can do this already! Just put your cursor to the right of this bracket: [
], then press shift+right arrow, then copy. now you can paste it into the string, or into a variable, and it will work with the say block.
This didn't work for me.

8to16 wrote:

You can do this with hacked blocks
here's an example:https://scratch.mit.edu/projects/1076436111/
This works.

Last edited by mysinginmonsters (Oct. 3, 2024 19:27:41)

starlightsparker
Scratcher
1000+ posts

multi line say blocks

mysinginmonsters wrote:

[
The escape sequence needs something following it. But this isn't a good idea since it could cause new programmers to get confused on why they can't type a backslash.
The best and easiest solution that solves most of the issues including yours, is to simply support using the return key.
medians
Scratcher
1000+ posts

multi line say blocks

starlightsparker wrote:

mysinginmonsters wrote:

[
The escape sequence needs something following it. But this isn't a good idea since it could cause new programmers to get confused on why they can't type a backslash.
The best and easiest solution that solves most of the issues including yours, is to simply support using the return key.
No, that may interfere with certain functionality, it should just be a newline block like in some mods:
newline::operators reporter
return/enter::operators reporter
Or just a block that says \n.

Last edited by medians (Oct. 3, 2024 20:07:33)

50_scratch_tabs
Scratcher
1000+ posts

multi line say blocks

I support, however I think the best way would be like shift+enter in string inputs. This would be helpful though.
mysinginmonsters
Scratcher
100+ posts

multi line say blocks

starlightsparker wrote:

No, that may interfere with certain functionality, it should just be a newline block like in some mods:
newline::operators reporter
return/enter::operators reporter
Or just a block that says \n.
That would definitely confuse new scratchers. When you click it or set a variable to it, it would just show empty. There will be tons of kids wondering what this mysterious block does and how to use it.

And I don't agree with pressing enter either because I always press enter to confirm instead of clicking off.

It's best to just stick with the hacked blocks if you really want newline.

Last edited by mysinginmonsters (Oct. 3, 2024 23:07:26)

Scratch137
Scratcher
1000+ posts

multi line say blocks

mysinginmonsters wrote:

(#19)

starlightsparker wrote:

No, that may interfere with certain functionality, it should just be a newline block like in some mods:
newline::operators reporter
return/enter::operators reporter
Or just a block that says \n.
That would definitely confuse new scratchers. When you click it or set a variable to it, it would just show empty. There will be tons of kids wondering what this mysterious block does and how to use it.

And I don't agree with pressing enter either because I always press enter to confirm instead of clicking off.

It's best to just stick with the hacked blocks if you really want newline.
How about Shift+Enter? It's used by lots of messaging sites precisely because the Enter key is taken.

Powered by DjangoBB