Discuss Scratch

han614698
Scratcher
1000+ posts

TextVariables

I would like {var} to report the variable.

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:

TOLORS wrote:

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)


<Scratch Wikian | Forum Helper | 6000+ Posts>

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

Interesting, but I think there could be a better escaping system. Backslashes.

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

I would say any text based scratch features are rejected.


The2000 wrote:

All suggestions are unnecessary. If a suggestion is necessary then it's a bug report.

dertermenter wrote:

April Fools Day on the forums has been a repeated privilege, not an expectation
han614698
Scratcher
1000+ posts

TextVariables

PkmnQ wrote:

Interesting, but I think there could be a better escaping system. Backslashes.

say [Hi, \\{han\\}] // Hi, {han}
Did you mean to do one or two backslashes each? Because I see your source has two, but the block has one…


Added to the OP.

dertermenter wrote:

I would say any text based scratch features are rejected.
Why? What part of the quote?

Last edited by han614698 (Aug. 17, 2021 12:37:43)


<Scratch Wikian | Forum Helper | 6000+ Posts>

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

han614698 wrote:

PkmnQ wrote:

Interesting, but I think there could be a better escaping system. Backslashes.

say [Hi, \\{han\\}] // Hi, {han}
Did you mean to do one or two backslashes each? Because I see your source has two, but the block has one…


Added to the OP.
One backslash. Trust the block, not the source. To escape backslashes, do this:
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)
say [{!xyz}]
A syntax like this would be better:
set [xyz v] to (25)
say [\\{xyz}]
Anyways, support. This would be very convienient and make code more readable. Ex:
say (join (number 1) (join [+] (join (number2) (join [=] (number3)))))
[/scratchblocks]
Sorry for the /scratchblocks, the tag doesn't close…
vs.
say [{number 1}+{number2}={number3}]
Way more readable.

Signatures are the only place where assets links still work.
Reev0102
Scratcher
1000+ posts

TextVariables

While this is an interesting idea, I 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:
set [myName v] to [Reev]
say (join [Hi, ] (myName))
han614698
Scratcher
1000+ posts

TextVariables

Reev0102 wrote:

While this is an interesting idea, I 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:
set [myName v] to [Reev]
say (join [Hi, ] (myName))
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.

<Scratch Wikian | Forum Helper | 6000+ Posts>

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

No support. Not only will this be confusing to new scratchers that see this inside a project, I would also consider this rejected – it still uses text-based syntax and doesn't fit well with the rest of Scratch.

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

han614698 wrote:

Reev0102 wrote:

While this is an interesting idea, I 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:
set [myName v] to [Reev]
say (join [Hi, ] (myName))
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.
But Scratch uses different blocks for different functions rather than text, and your suggestion is for the latter.
han614698
Scratcher
1000+ posts

TextVariables

The next sentence is a lie I AM BUMPING THIS. The prior sentence is a lie.


<Scratch Wikian | Forum Helper | 6000+ Posts>

Credit to -gge for the icons in my signature | I condensed all this code into five lines using [p] tags, idk why




han614698
Scratcher
1000+ posts

TextVariables

Bump

<Scratch Wikian | Forum Helper | 6000+ Posts>

Credit to -gge for the icons in my signature | I condensed all this code into five lines using [p] tags, idk why




ScolderCreations
Scratcher
1000+ posts

TextVariables

Support, this would be convenient, as this
([hi, {foo}, how are you?])
Is easier than this:
(join (join [hi,] (foo)) [, how are you?])

AlfabetonsOfficial
Scratcher
100+ posts

TextVariables

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.

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

AlfabetonsOfficial wrote:

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.
not all reporters are user made variables…

CLARIFICATION: THIS WOULD ONLY WORK FOR USER MADE VARIABLES.

Last edited by han614698 (Aug. 18, 2021 20:55:40)


<Scratch Wikian | Forum Helper | 6000+ Posts>

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

Removed, Misread OP

Last edited by Ciyob86 (Aug. 18, 2021 22:39:42)

han614698
Scratcher
1000+ posts

TextVariables

Ciyob86 wrote:

This?:
say (join [Hello, ](getvar[Name]::Variables Reporter)
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!

<Scratch Wikian | Forum Helper | 6000+ Posts>

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

Maybe it should be its own separate operators block, but I'm not sure what it should be called.

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

PkmnQ wrote:

Maybe it should be its own separate operators block, but I'm not sure what it should be called.
Huh? The idea was for you to be able to type very quickly…

say [hi {foo}]

<Scratch Wikian | Forum Helper | 6000+ Posts>

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

I think a custom reporter will be better:
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

Powered by DjangoBB