Discuss Scratch
- frdsaw
-
7 posts
Elif (else-if) block
I suggest adding an Elif (else-if) Block so you don't have to have numerous else and if blocks. I also suggest, with this, that you can change the elif amount ( making it changeable by length through numbers as part of the elif block.).
I hope you take this into account, as I would find it very useful.
(Feels like a speech! XD)
I hope you take this into account, as I would find it very useful.

- AonymousGuy
-
1000+ posts
Elif (else-if) block
What would this look like? Would it be multiple ifs part of one block?
- mathfreak231
-
1000+ posts
Elif (else-if) block
(sorry for abrupt edit but my opinions have changed and because i am one of the first few posters i need to look good)
Don't call it “elif”, just because it's used in Python doesn't mean the name won't be confusing.
The block (renamed) may just work but maybe it will be too cluttering with the “+”s? It's useful but will require reorganization…
Don't call it “elif”, just because it's used in Python doesn't mean the name won't be confusing.
The block (renamed) may just work but maybe it will be too cluttering with the “+”s? It's useful but will require reorganization…
Last edited by mathfreak231 (July 18, 2015 14:06:11)
- ProdigyZeta7
-
1000+ posts
Elif (else-if) block
if <>Ah, there we go.
else <>
else <>
end
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.

- jontmy00
-
500+ posts
Elif (else-if) block
I support, and ProdigyZeta7, that would actually be quite a useful feature!
It'd be nice if there were a feature like that for “and”, “or”, and so on sort of blocks.
It'd be nice if there were a feature like that for “and”, “or”, and so on sort of blocks.
- scimonster
-
1000+ posts
Elif (else-if) block
Python users do, as that's the name of the Python keyword. First of all, nobody calls it Elif. It's “elseif” or “else if”.
What's wrong with simply stacking if/elses?
if <...> then
...
else
if <...> then
...
else
if <...> then
...
else
if <...> then
...
else
...
- gravtest
-
100+ posts
Elif (else-if) block
Python, C? First of all, nobody calls it Elif
Sci's right, as always

- mathfreak231
-
1000+ posts
Elif (else-if) block
Oh. Well I've never seen it before in Python (probably because I barely read Python or many other scripting languages at all; I'm a Lua person because I'm a Robloxian).Python users do, as that's the name of the Python keyword. First of all, nobody calls it Elif. It's “elseif” or “else if”.
- frdsaw
-
7 posts
Elif (else-if) block
if <>
else <>
else<+> <->
end
This, but with the second to last “else” to be “elif”, and the last else to be removed, also the + and - to be buttons.
Last edited by frdsaw (Dec. 4, 2013 16:45:25)
- AonymousGuy
-
1000+ posts
Elif (else-if) block
oh, elseif. I'm not very smart!
Yes, I think this could be a good idea.
Yes, I think this could be a good idea.
- cwrivera99
-
500+ posts
Elif (else-if) block
if <>Ah, there we go.
else <>
else <>
end
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.
If < > Then
Else
If < > Then
Else
Last edited by cwrivera99 (Dec. 6, 2013 18:43:09)
- lucs100
-
10 posts
Elif (else-if) block
Python users do, as that's the name of the Python keyword. First of all, nobody calls it Elif. It's “elseif” or “else if”.
What's wrong with simply stacking if/elses?if <...> then
...
else
if <...> then
...
else
if <...> then
...
else
if <...> then
...
else
...
Well, in this Project that I made, using that many else / if blocks was extremely annoying and painstaking. To give the user more chances before crashing (see inside the project) would make it 12 or more else / if blocks thick!
- Tymewalk
-
1000+ posts
Elif (else-if) block
I play around with programming languages other than Scratch a little, and I notice they have something Scratch doesn't have - an else-if block.
For example, this example code uses elseif:
if (thing) {
do stuff
} else if (other thing) {
do other stuff
} else {
more stuff
}
I think this could be included in the if-else block by adding two arrows button on the side of the block, like some other blocks in Snap! have, to add an else if. I see that you can already do this with nested if-else blocks, but that gets really messy and confusing quickly. Here is what I am talking about by “nested if-else”:
Zebra coloring would not be added, because the if/else if/else will be one big block, like this:
Tymewalk (That's me! Wait, don't I already support my own idea?)
MathlyCat
JamesOuO
cwkethan1508
liam48D
theonlygusti
IronBit_Studios
Nether_before
Vetpetmon
A-no-meep
chuckdaboss
Gaza101
pokejafe
PotOfGold
14 supporters
Semi-supporters:
stickfiregames
matey1234
Invisibowl
Who else thinks this is a good idea?
For example, this example code uses elseif:
if (thing) {
do stuff
} else if (other thing) {
do other stuff
} else {
more stuff
}
I think this could be included in the if-else block by adding two arrows button on the side of the block, like some other blocks in Snap! have, to add an else if. I see that you can already do this with nested if-else blocks, but that gets really messy and confusing quickly. Here is what I am talking about by “nested if-else”:
if <condition> then
some stuff
else
if <condition2> then
do other stuff
end
end
Zebra coloring would not be added, because the if/else if/else will be one big block, like this:
if <> thenPeople who think this is a good idea (AKA Supporters):
example
else if <> :: celse
another example
else if <> :: celse
more stuff
else
yet another example
end
Tymewalk (That's me! Wait, don't I already support my own idea?)
MathlyCat
JamesOuO
cwkethan1508
liam48D
theonlygusti
IronBit_Studios
Nether_before
Vetpetmon
A-no-meep
chuckdaboss
Gaza101
pokejafe
PotOfGold
14 supporters
Semi-supporters:
stickfiregames
matey1234
Invisibowl
Who else thinks this is a good idea?
Last edited by Tymewalk (July 2, 2015 20:43:55)
- DaSpudLord
-
1000+ posts
Elif (else-if) block
I think this is what you want-
if <> thenNo support. Easy workaround-
else if <> then :: celse
else
end
if <> then
else
if <> then
else
end
end
- Tymewalk
-
1000+ posts
Elif (else-if) block
I think this is what you want-if <> thenNo support. Easy workaround-
else if <> then :: celse
else
endif <> then
else
if <> then
else
end
end
Yes, that is what I want. I'm trying to get it added into Scratch. By “no support” you mean that the block can't be added to the editor by the Scratch team?
Last edited by Tymewalk (May 21, 2015 21:11:56)
- Birdlegs
-
1000+ posts
Elif (else-if) block
No support means he doesn't think it's a good idea. Honestly, I don't like the system we use around here. “No support” always comes off sounding way more harsh than it should. If I don't think Scratch should have something, I simply explain why I think that. And I can see where this would be handy if you were getting really cluttered
- ChocolatePi
-
1000+ posts
Elif (else-if) block
Other languages (other than Python, ick) don't have this feature. Using an “else if” conditional would be the same as doing else then a line break then an if. I don't think Scratch needs this, although I would like a switch structure.
- MathlyCat
-
1000+ posts
Elif (else-if) block
Instant suggestion! (just gonna point that out) No support means he doesn't think it's a good idea. Honestly, I don't like the system we use around here. “No support” always comes off sounding way more harsh than it should. If I don't think Scratch should have something, I simply explain why I think that. And I can see where this would be handy if you were getting really cluttered
Sounds very helpful, it would also make your code less messy, seems to me lots more pros, Support!