Discuss Scratch
- stickfiregames
-
Scratcher
1000+ posts
letters () to () of () block
Why didn't I think of doing that?Support since other programming languages can do this. Also the workaround is very slow as I noticed when I used it to make a cloud encoder.Even with the “no screen refresh” thing disabled? Wow.

- MushroomMan99
-
Scratcher
100+ posts
letters () to () of () block
If a New Scratcher wanted to make a Pig Latin translator like I did, the workaround would be far too complicated for them to understand so even if limiting the number of blocks makes things simpler, I still think it would be simpler to have the block
- DadOfMrLog
-
Scratcher
1000+ posts
letters () to () of () block
I've made… it… clear… before… (alongside many others) that I'd really like to see this block added - it would simplify the scripting of so many other string operations!
Scratch is relatively slow, since it has to perform translation of the blocks. That means the workaround takes several orders of magnitude longer than a built-in block would. And Scratch could really use all the help it can get, where doing so has no barriers to understanding - I have a hard time believing that anyone who can understand “letter N of STRING” would struggle with “letters M to N of STRING”. And as mentioned above, a built-in block is clearly way simpler than having to work out the script yourself.
It could be argued that it takes away the opportunity to learn a useful script. However, I have to admit that I can't see it as much of a loss, since the same basic loop construction appears in so many other situations…
However, the behaviour for cases like M<1, and/or N>length… I'd say it should just take its cue from the current behaviour of “letter N of STRING”, which ignores those parts beyond the start and end. As for M>N, well…

(Not suggesting a native ‘letters M to N" block should do that, though I’d hardly complain if there was a faster built-in way to do such a reversing…)
I get a bit annoyed when I see really short responses to suggestions.*Asks slightly nervously*… What about really long responses…? (Well, you did say “Please take the time to support your opinions with some arguments”!)
I like to do text manipulation projects at times and I would love to have this block. Sure, there are ways to work around it - but they are not very clean. However, I also recognize that Scratch is intended to be simple to learn - and one way to keep it simple is to limit the number of blocks. So there have to be some very compelling benefits before a new block is added to the pallet.Apart from, as I mentioned at the start, making so many other things simpler, one compelling benefit is speed.
Scratch is relatively slow, since it has to perform translation of the blocks. That means the workaround takes several orders of magnitude longer than a built-in block would. And Scratch could really use all the help it can get, where doing so has no barriers to understanding - I have a hard time believing that anyone who can understand “letter N of STRING” would struggle with “letters M to N of STRING”. And as mentioned above, a built-in block is clearly way simpler than having to work out the script yourself.
It could be argued that it takes away the opportunity to learn a useful script. However, I have to admit that I can't see it as much of a loss, since the same basic loop construction appears in so many other situations…
Ah yes, slicing. Unfortunate for the undefined behaviors here, such as invalid indexes. Will the starting index be inclusive and the ending index be exclusive, as in Python, such that end - start = length? Or will both be inclusive?I don't see any ambiguity in the *meaning* here - the wording makes it clear (unlike a not-immediately-determinative operator name like ‘slice’ or some form of indexing).
However, the behaviour for cases like M<1, and/or N>length… I'd say it should just take its cue from the current behaviour of “letter N of STRING”, which ignores those parts beyond the start and end. As for M>N, well…
A text reverse block would go well with this.As it happens, the string-manipulation project in my sig has a “letters M to N of STRING” custom block, and that reverses the order of characters if M>N.

(Not suggesting a native ‘letters M to N" block should do that, though I’d hardly complain if there was a faster built-in way to do such a reversing…)
Last edited by DadOfMrLog (Aug. 27, 2014 16:41:46)
- imadrainpipe
-
Scratcher
100+ posts
letters () to () of () block
this would be very useful for compiling lists
- TimothyLawyer
-
Scratcher
1000+ posts
letters () to () of () block
letters (1) to (3) of [world] :: customHonestly, though, that's why we need custom reporter blocks in general.
say (return) for (2) secs
say (letters (1) to (3) of [yes custom operators] :: custom) for (3e7) secs
- HOWING
-
Scratcher
500+ posts
letters () to () of () block
I am suggesting a block like thisWhat section does this go?(letters (1) to (3) of [world])
- TimothyLawyer
-
Scratcher
1000+ posts
letters () to () of () block
What section does this go?It would be an operator
(letters (1) to (3) of [world] :: operators)similar to letter ( ) of [ ].
- KingOfAwesome58219
-
Scratcher
1000+ posts
letters () to () of () block
That would be useful for games like Hangman. Support.
- xX_Damion_Xx
-
Scratcher
40 posts
letters () to () of () block
FULL SUPPORT!
REAAAALY useful for online saving.
REAAAALY useful for online saving.
- Charles12310
-
Scratcher
1000+ posts
letters () to () of () block
This block should definitely be added for many purposes such as quizzes, and so we don't have to keep on using join blocks, and so we don't have to do too much scripting for detection.
Last edited by Charles12310 (Oct. 11, 2017 23:14:50)
- MCGUY15
-
Scratcher
100+ posts
letters () to () of () block
(letters (2) to (8) of (qsupportdjjfisnvoa)
- gavinskycastle
-
Scratcher
85 posts
letters () to () of () block
I am suggesting a block like this(letters (1) to (3) of [world])
Cool idea! I've made scripts that act similarly to this, but this would definitely oversimplifiy it
. - DaEpikDude
-
Scratcher
1000+ posts
letters () to () of () block
yeah okEdited my post.bump (formerly SUPPORT)Why?
- calulord
-
Scratcher
100+ posts
letters () to () of () block
I actually made my own topic for this before I was informed this one already existed.
Support, this would make things a lot easier.
Support, this would make things a lot easier.
- ninjaMAR
-
Scratcher
1000+ posts
letters () to () of () block
bump
support
i have always wanted this block
support
i have always wanted this block

















