Discuss Scratch
- han614698
- Scratcher
1000+ posts
TextVariables
For example,
set [my name v] to (han)
say [Hi, {my name}!]
Would say “Hi, han!”
Well, what if you want to type with {} in a say block withOUT it being a variable?
Type
say [Hi, \{han\}]
And it will say “Hi, {han}”
EDIT: does this fall under 2.2 of TOLORS?
Here’s the quote:
2.2 Text-based syntax in Scratch
Some users wish to code Scratch not with the blocks, but with typing code instead (similar to how more advanced programming languages work). Others are interested in an option to view, convert, or download Scratch code to other programming languages. However, the Scratch Team has discussed this possibility multiple times and has decided every time that it would not be beneficial for beginners or teachers.
This suggestion extends to coding, viewing, converting, or downloading Scratch in any text-based language, including BBCode, Javascript, some form of pseudocode, or some other programming language. If you wish to code using another language, then you can learn it on your own, but it would have to be done outside of Scratch. For those who are interested, it may be worth checking out Tosh. It is a text-based programming language that serves as a text editor for Scratch projects.
Za-Chary is not sure if this is rejected.
Last edited by han614698 (Aug. 18, 2021 13:03:50)
Credit to -gge for the icons in my signature | I condensed all this code into five lines using [p] tags, idk why
- PkmnQ
- Scratcher
1000+ posts
TextVariables
say [Hi, \\{han\\}] // Hi, {han}
This is an account that exists.
Here, have a useful link:
The Official List of Rejected Suggestions by Za-Chary
- dertermenter
- Scratcher
1000+ posts
TextVariables
All suggestions are unnecessary. If a suggestion is necessary then it's a bug report.
repeated privilege, not an expectationApril Fools Day on the forums has been a
- han614698
- Scratcher
1000+ posts
TextVariables
Did you mean to do one or two backslashes each? Because I see your source has two, but the block has one… Interesting, but I think there could be a better escaping system. Backslashes.say [Hi, \\{han\\}] // Hi, {han}
Added to the OP.
Why? What part of the quote? I would say any text based scratch features are rejected.
Last edited by han614698 (Aug. 17, 2021 12:37:43)
Credit to -gge for the icons in my signature | I condensed all this code into five lines using [p] tags, idk why
- PkmnQ
- Scratcher
1000+ posts
TextVariables
One backslash. Trust the block, not the source. To escape backslashes, do this:Did you mean to do one or two backslashes each? Because I see your source has two, but the block has one… Interesting, but I think there could be a better escaping system. Backslashes.say [Hi, \\{han\\}] // Hi, {han}
Added to the OP.
say [Backslashes! \\\\]
This is an account that exists.
Here, have a useful link:
The Official List of Rejected Suggestions by Za-Chary
- mybearworld
- Scratcher
1000+ posts
TextVariables
set [!xyz v] to (25)A syntax like this would be better:
say [{!xyz}]
set [xyz v] to (25)Anyways, support. This would be very convienient and make code more readable. Ex:
say [\\{xyz}]
say (join (number 1) (join [+] (join (number2) (join [=] (number3)))))Sorry for the /scratchblocks, the tag doesn't close…
[/scratchblocks]
vs.
say [{number 1}+{number2}={number3}]Way more readable.
Signatures are the only place where assets links still work.
- Reev0102
- Scratcher
1000+ posts
TextVariables
set [myName v] to [Reev]
say (join [Hi, ] (myName))
- han614698
- Scratcher
1000+ posts
TextVariables
don't support. This may be confusing to new Scratchers, and Scratch uses different blocks for different things rather than text. Plus, this is easily workaroundable:They don’t have to use it if they don’t want to. Why do we have the abs of block? They can use the only way they know, and the more advanced scratchers can have an easier life. While this is an interesting idea, Iset [myName v] to [Reev]
say (join [Hi, ] (myName))
Credit to -gge for the icons in my signature | I condensed all this code into five lines using [p] tags, idk why
- Quantum-Cat
- Scratcher
1000+ posts
TextVariables
Notice: Everything below the solid grey line (↑↑) above is my signature and appears on every post I make. Here, it is okay for you to advertise
your projects and other creations. To create your own, scroll to the bottom of the Discussion Home page and select “change your signature”.
I aplogise if I seem a bit too serious on the forums, but I am always open to feedback on my profile.
Past PPTBF Curator || Forum Helper (TFH) || Some Python, HTML and C
————————————————————————————
————————————————————————————
Quantum-Cat
- Reev0102
- Scratcher
1000+ posts
TextVariables
But Scratch uses different blocks for different functions rather than text, and your suggestion is for the latter.don't support. This may be confusing to new Scratchers, and Scratch uses different blocks for different things rather than text. Plus, this is easily workaroundable:They don’t have to use it if they don’t want to. Why do we have the abs of block? They can use the only way they know, and the more advanced scratchers can have an easier life. While this is an interesting idea, Iset [myName v] to [Reev]
say (join [Hi, ] (myName))
- ScolderCreations
- Scratcher
1000+ posts
TextVariables
([hi, {foo}, how are you?])Is easier than this:
(join (join [hi,] (foo)) [, how are you?])
- AlfabetonsOfficial
- Scratcher
100+ posts
TextVariables
Last edited by AlfabetonsOfficial (Aug. 18, 2021 20:54:38)
Let's learn Spanish with the Alfabetons!
Click here to get started!
Visit the official Alfabetons website!
- han614698
- Scratcher
1000+ posts
TextVariables
not all reporters are user made variables… No support, this would defeat the purpose of the join block. Also, it's possible to name a variable as a built-in variable in Scratch, so this could be ambiguous.
CLARIFICATION: THIS WOULD ONLY WORK FOR USER MADE VARIABLES.
Last edited by han614698 (Aug. 18, 2021 20:55:40)
Credit to -gge for the icons in my signature | I condensed all this code into five lines using [p] tags, idk why
- Ciyob86
- Scratcher
500+ posts
TextVariables
Last edited by Ciyob86 (Aug. 18, 2021 22:39:42)
- han614698
- Scratcher
1000+ posts
TextVariables
that's literally the same as it is now but with an extra block. You still have to use a join block and a reporter! This?:say (join [Hello, ](getvar[Name]::Variables Reporter)
Credit to -gge for the icons in my signature | I condensed all this code into five lines using [p] tags, idk why
- PkmnQ
- Scratcher
1000+ posts
TextVariables
This is an account that exists.
Here, have a useful link:
The Official List of Rejected Suggestions by Za-Chary
- han614698
- Scratcher
1000+ posts
TextVariables
Huh? The idea was for you to be able to type very quickly… Maybe it should be its own separate operators block, but I'm not sure what it should be called.
say [hi {foo}]
Credit to -gge for the icons in my signature | I condensed all this code into five lines using [p] tags, idk why
- gilbert_given_189
- Scratcher
500+ posts
TextVariables
say (formatted text [something {foo} {bar}] :: operators)
If you see a line above this text, it means that below this text is my signature.
This place is just a memory to me, I may return occasionally but I'm busy.
I guess I'm an ATer now.
I think I may have seasoned my posts a bit too much.
Colored Pencil is supposed to color the siggy, but Scratch says it's too big.
There is nothing here…
don don pan pan
dondo pan pan