Discuss Scratch

medians
Scratcher
1000+ posts

Elif (else-if) block

slothdoodles wrote:

I feel like scratch should really implement this. I've looked through this and most of the problems people have are “oh the workaround is so easy” and “the workaround isn't messy” and “Children don't know what elif means!” and I've seen “Programming languages (except python, ick) don't have an elif”

I believe that MIT should work on this, as it would be great for scratchers. If we look at other programming languages, practically all of them have some sort of elif. Lets take python:

(a bunch of examples)

Practically ALL programming languages have an else if, so why can't scratch? I agree with having (+ -) at the bottom off a if () else () block. If anyone has some reason this shouldn't be implemented, tell me about it and I probably will counter it with a valid argument in at least a day.
Yeah, here's what I believe:
1. The workaround can get really messy if you need “else if” multiple times.
2. Concerns about the name could be avoided if “else if” was used for the block instead of “elif” (which would have the same meaning). Scratch already uses “if” and “if else”, so I don't think “else if” would be that confusing.
Anyway, where did you see people state that programming languages don't have elif/else if? If that's true, then they don't know what they're talking about lol

Last edited by medians (April 4, 2025 01:23:33)

hoppingcoin404
Scratcher
50 posts

Elif (else-if) block

ProdigyZeta7 wrote:

if <>
else <>
else <>
end
Ah, there we go.

So how would this be made, exactly? Would there be (+) at the bottom part of the loop so when it's clicked the above happens? I support.
It's
if <> then {
} else if <> then {
} else {
} :: control
Not
if <>
else <>
else <>
end
aaliyaan0110
Scratcher
500+ posts

Elif (else-if) block

nobody knows about mods of scratch THEY HAVE THAT USE THEM I REPEAT USE THEM!!!
medians
Scratcher
1000+ posts

Elif (else-if) block

aaliyaan0110 wrote:

nobody knows about mods of scratch THEY HAVE THAT USE THEM I REPEAT USE THEM!!!
You can use them, but those mods are unofficial. We are suggesting to add the block to Scratch.
-Kat_Kafe
Scratcher
500+ posts

Elif (else-if) block

I support this idea, though “elif” is a weird and confusing name.
CodeComet6161
Scratcher
1000+ posts

Elif (else-if) block

What's the point of having an individual block when you just do this:
if <> then 



else
if <> then



else

end

end

No support.
Shuaib_Zaker
Scratcher
74 posts

Elif (else-if) block

CodeComet6161 wrote:

What's the point of having an individual block when you just do this:
if <> then 



else
if <> then



else

end

end

No support.
It gets very very mess if you have a lot.
CodeComet6161
Scratcher
1000+ posts

Elif (else-if) block

Shuaib_Zaker wrote:

CodeComet6161 wrote:

What's the point of having an individual block when you just do this:
if <> then 



else
if <> then



else

end

end

No support.
It gets very very mess if you have a lot.

Then this:

if then

else if

else if

else if…
theoW1200
Scratcher
100+ posts

Elif (else-if) block

I would definitely like an elif block.
A switch/pattern-matching block would be nice as well.
theoW1200
Scratcher
100+ posts

Elif (else-if) block

PIXEL_BY_PIXEL_ERROR wrote:

New scratchers would have absolutely no clue what “Elif” means.

I swear that's half the excuses for rejecting something
mcsquaggle
Scratcher
500+ posts

Elif (else-if) block

theoW1200 wrote:

PIXEL_BY_PIXEL_ERROR wrote:

New scratchers would have absolutely no clue what “Elif” means.

I swear that's half the excuses for rejecting something
fr
medians
Scratcher
1000+ posts

Elif (else-if) block

theoW1200 wrote:

PIXEL_BY_PIXEL_ERROR wrote:

New scratchers would have absolutely no clue what “Elif” means.

I swear that's half the excuses for rejecting something
In this case, they could just call it “else if”. Also, when this topic was made, there was a feature called the Tips Window that explained blocks
theoW1200
Scratcher
100+ posts

Elif (else-if) block

bump
Toodchop
Scratcher
100+ posts

Elif (else-if) block

There's already an easy workaround.

Last edited by Toodchop (July 26, 2025 02:21:39)

theoW1200
Scratcher
100+ posts

Elif (else-if) block

Toodchop wrote:

There's already an easy workaround.
nesting is bad doe
CodeComet6161
Scratcher
1000+ posts

Elif (else-if) block

bump

theoW1200 wrote:

Toodchop wrote:

There's already an easy workaround.
nesting is bad doe
that's not nesting, nesting is when something is extended in a specific way. for example, a nested input
(length of [])
jmdzti_0-0
Scratcher
1000+ posts

Elif (else-if) block

CodeComet6161 wrote:

What's the point of having an individual block when you just do this:
if <> then 



else
if <> then



else

end

end

No support.
https://u.cubeupload.com/jmdzti_/block10152025120522A.png
CodeComet6161
Scratcher
1000+ posts

Elif (else-if) block

jmdzti_0-0 wrote:

CodeComet6161 wrote:

What's the point of having an individual block when you just do this:
if <> then 



else
if <> then



else

end

end

No support.
https://u.cubeupload.com/jmdzti_/block10152025120522A.png
if <> then{

}elif <> then{

}elif <> then{

}elif <> then{

}elif <> then::control
...
tagrim123
Scratcher
500+ posts

Elif (else-if) block

if <> then \+ \-{
...
} else-if <> \+ \-{
...
}::control

Last edited by tagrim123 (Oct. 15, 2025 00:55:08)

tagrim123
Scratcher
500+ posts

Elif (else-if) block

Bump

Powered by DjangoBB