Discuss Scratch

Hypersaurus
Scratcher
100+ posts

NOT REJECTED: IF THEN FOREVER

This block was in the Scratch 1.4 editor, and worked the same as putting an “if” block inside a “forever” loop. It was removed in Scratch 2.0 because many beginners found it to be confusing. The aforementioned workaround is evidently simple and more intuitive.
forever if <> then{
}::control
However, an If then forever is NOT rejected because it acts different.
if <> then forever{ 

}:: control
as it would act diffrent
How would an If then forever work? Well it's simple, if the statement inside the boolean is true, like
if <(my variable)=(5)> then forever{
turn cw (12) degrees
}::control
it will repeat the code inside it forever, if it is false, like
if <not<(my variable) = [5]>> then forever{
turn cw (12) degrees
}:: control
it goes to any code under it, and like you expect if in another forever it can recheck itself when it is reached again.
This is NOT rejected because this is a different block with a different function, and the order of which the block is worded explains it pretty clearly: If something is true, do forever.
There are work arounds but many blocks have it so do not give work arounds.
scratchy_boy106
Scratcher
1000+ posts

NOT REJECTED: IF THEN FOREVER

if <...::grey> then
forever

end
end
ScodexPerson
Scratcher
1000+ posts

NOT REJECTED: IF THEN FOREVER

This will have the same issue as the rejected ‘Forever if <>’ C block which is that it will be confusing for new programmers.
gdfsgdfsgdfg
Scratcher
1000+ posts

NOT REJECTED: IF THEN FOREVER

isn’t it just
repeat until <not <>>

end
blocks with easy workarounds are in the editor because it’s designed for beginners and convenience
not to mention some blocks are a standard in programming languages

edit:
I might be reading the op wrong but I don’t see any point for this block to be in the editor

Last edited by gdfsgdfsgdfg (July 17, 2026 11:47:53)

medians
Scratcher
1000+ posts

NOT REJECTED: IF THEN FOREVER

gdfsgdfsgdfg wrote:

isn’t it just
repeat until <not <>>

end
blocks with easy workarounds are in the editor because it’s designed for beginners and convenience
not to mention some blocks are a standard in programming languages

edit:
I might be reading the op wrong but I don’t see any point for this block to be in the editor
I think it's more like this:
if <bool::grey> then
forever
code::grey
end
end
Though I'm worried people might think this is like a repeat until loop like you did if this is what it's supposed to be

Last edited by medians (July 17, 2026 13:09:14)

Za-Chary
Scratcher
1000+ posts

NOT REJECTED: IF THEN FOREVER

Suppose I run the following code:

if <(my variable)=(5)> then forever{
turn cw (12) degrees
}::control

Then, while this code is still running, I change “my variable” to 0. My question is, does the sprite stop turning or not?

If it does stop turning, then this is an easy workaround (and is in fact the same as that old “forever if” block:

forever
if <(my variable)=(5)> then
turn cw (12) degrees
end
end

If it doesn't stop turning, then this is an easy workaround:

if <(my variable)=(5)> then
forever
turn cw (12) degrees
end
end

In either case, the fact that I am asking this question should suggest that the name of this block is still confusing. Even if it acts differently, I think newer Scratchers would still find it confusing.
Paddle2See
Scratch Team
1000+ posts

NOT REJECTED: IF THEN FOREVER

I agree - I feel it is easier for beginners to keep separate actions in separate blocks.

Powered by DjangoBB