Discuss Scratch
- OmnipotentPotato
-
Scratcher
1000+ posts
Otherwise If
What exactly is the difference between the if-else system we already have?
- jaboyc
-
Scratcher
100+ posts
Otherwise If
What exactly is the difference between the if-else system we already have?Well, first, it tests the first if <>. If its true, it ignores all the other if else's. If the first <> is false, then it tests the first else ifs <>. If its true, it ignores all the other else ifs but if its false, it goes to the next else if. This keeps repeating until either one of the else ifs are true or it hits the else statement. I hope I answered your question!
- HOWING
-
Scratcher
500+ posts
Otherwise If
Workaround:
if <condition :: operators> then
//Your blocks here
else
if <condition :: operators> then
//Your blocks here
end
end
//Note: Don't put any blocks after the if block in the else
- popek04
-
Scratcher
100+ posts
Otherwise If
Also:1. ELSE IF, not OTHERWISE IFif <> thenYou can keep on you post:
else if <> then :: celse // do do that use ":: celse"else if <> then :: cstart control
end
EDIT: IF this was in 1.4 then There COULD be another block:
forever if <>
else if <>:: celse
end
2.
define <1><2>
forever if<1> //Shorter, you can add this block
else if<2>::celse
end
define <1><2>
forever //This block I don't want to do
if <1>
else
if <2>
end
end
Last edited by popek04 (Sept. 26, 2014 15:11:39)
- popek04
-
Scratcher
100+ posts
Otherwise If
Workaround:if <condition :: operators> then
//Your blocks here
else
if <condition :: operators> then
//Your blocks here
end
end
//Note: Don't put any blocks after the if block in the else
...//Use this block
- Frenzar
-
Scratcher
100+ posts
Otherwise If
Just do this:if <> then
else
if <> then
else
if <> then
else
end
end
end
- Think_Quest
-
New Scratcher
14 posts
Otherwise If
Support, because elseif exists (in other programming languages) for a reason. If it weren't a big deal nesting then elseif wouldn't exist, though I guess some ppl don't mind. I personally will go nuts if there are too many if/else. I guess it varies from person to person.
- RPFluffy
-
Scratcher
1000+ posts
Otherwise If
Also:if <> thenYou can keep on you post:
else if <> then :: celse // do do that use ":: celse"else if <> then :: cstart control
end
EDIT: IF this was in 1.4 then There COULD be another block:
forever if <>
else if <>:: celse
end
The forever if workaround is easy, it's this (surprisingly!):
if <> then
forever
end
end
But for the if and constant else, sure!
Maybe you could right click the else part and it would say “add else” and then it would add another else?
- stickfiregames
-
Scratcher
1000+ posts
Otherwise If
Actually it isAlso:if <> thenYou can keep on you post:
else if <> then :: celse // do do that use ":: celse"else if <> then :: cstart control
end
EDIT: IF this was in 1.4 then There COULD be another block:
forever if <>
else if <>:: celse
end
The forever if workaround is easy, it's this (surprisingly!):if <> then
forever
end
end
But for the if and constant else, sure!
Maybe you could right click the else part and it would say “add else” and then it would add another else?
foreverand that is why it was removed - no-one could remember which way round it was.
if <> then
end
end
- RPFluffy
-
Scratcher
1000+ posts
Otherwise If
Actually it isAlso:if <> thenYou can keep on you post:
else if <> then :: celse // do do that use ":: celse"else if <> then :: cstart control
end
EDIT: IF this was in 1.4 then There COULD be another block:
forever if <>
else if <>:: celse
end
The forever if workaround is easy, it's this (surprisingly!):if <> then
forever
end
end
But for the if and constant else, sure!
Maybe you could right click the else part and it would say “add else” and then it would add another else?foreverand that is why it was removed - no-one could remember which way round it was.
if <> then
end
end
Actually think about it, it would go on forever if this happened, so actually:
if <> then
forever
end
end
- stickfiregames
-
Scratcher
1000+ posts
Otherwise If
Actually think about it, it would go on forever if this happened, so actually:It is meant to go on forever. Open up 1.4 and try it.if <> then
forever
end
end
Last edited by stickfiregames (Nov. 13, 2014 07:33:15)




:


:
:
: