Discuss Scratch

KittyFireSt0rm
Scratcher
1000+ posts

"Delete all occurrences of" block

Bump
BosenChang
Scratcher
1000+ posts

"Delete all occurrences of" block

KittyFireSt0rm wrote:

BosenChang wrote:

-snip-

Yes, I get that there is a functional workaround for the
 delete all occurrences of ( ) in [list v] :: list 

But what about deleting all occurrences across multiple lists?
Hmm, you got that point right. (This would have worked a lot easier if dropdowns in custom blocks was added. Dang it!)
KittyFireSt0rm
Scratcher
1000+ posts

"Delete all occurrences of" block

Bump!
KittyFireSt0rm
Scratcher
1000+ posts

"Delete all occurrences of" block

bump
criticize
New Scratcher
33 posts

"Delete all occurrences of" block

(Removed)

Last edited by criticize (April 6, 2022 07:09:20)

scratchastroLOL
Scratcher
1000+ posts

"Delete all occurrences of" block

criticize wrote:

Support.
why do you support? please be constructive
BosenChang
Scratcher
1000+ posts

"Delete all occurrences of" block

criticize wrote:

Support.
A New Scratcher! doesn't know much about Scratch.
leahcimto
Scratcher
1000+ posts

"Delete all occurrences of" block

Ok people, lets get back on topic.

Support! I would not have to use this much, but I can see how this would be useful for other people.
Also to all you guys saying there is a workaround, a lot blocks have a work around, even the forever block has a workaround, but that does not mean that they can't get added
ggenije
Scratcher
500+ posts

"Delete all occurrences of" block

KittyFireSt0rm wrote:

Yes, I get that there is a functional workaround for the
 delete all occurrences of ( ) in [list v] :: list 

But what about deleting all occurrences across multiple lists?

Your suggestion is too specific.

The point for the scratch block is that they have general use, that means they are very diverse - their usage have diversity,
unlike them your suggestion will have usage 0.0000000000001% compared of other blocks, because only 0.000001% scratchers will use the block in 0.001% projects 0.001% times..

Analogy for the suggestion
set [color v] effect to (20) for all sprites ::looks

You can see there is obvious workaround , but that block is not diverse to be enough useful of every scratcher, just like your suggestion,

You surely don't have 100 lists , so you can't simple do the previous workaround 100 times.

This is the working workaround:
define delete all instances of (name) in my lists
set [i v] to (length of [myList1 v] :: list)
repeat (length of [myList1 v] :: list)
if <(item (i) of [myList1 v] :: list) = (name)> then
delete item (i) of [myList1 v]::list
end
change [i v] by (-1)
end
//
set [i v] to (length of [myList2 v] :: list)
repeat (length of [myList2 v] :: list)
if <(item (i) of [myList2 v] :: list) = (name)> then
delete item (i) of [myList2 v]::list
end
change [i v] by (-1)
end
...
set [i v] to (length of [myListN v] :: list)
repeat (length of [myListN v] :: list)
if <(item (i) of [myListN v] :: list) = (name)> then
delete item (i) of [myListN v]::list
end
change [i v] by (-1)
end

When your suggestion would be reasonable, that means you also can expect from ST to make block
import minecraft::pen


fdreerf
Scratcher
1000+ posts

"Delete all occurrences of" block

ggenije wrote:

This is the working workaround:
-snip- ::grey
Can't that be reduced to:
repeat until <not <[list v] contains [thing] ?>>
delete (item # of [thing] in [list v] :: list) of [list v]
end
KittyFireSt0rm
Scratcher
1000+ posts

"Delete all occurrences of" block

fdreerf wrote:

ggenije wrote:

This is the working workaround:
-snip- ::grey
Can't that be reduced to:
repeat until <not <[list v] contains [thing] ?>>
delete (item # of [thing] in [list v] :: list) of [list v]
end

Yes it could be, and I'm currently using that workaround, but I still have hope for this suggestion
KittyFireSt0rm
Scratcher
1000+ posts

"Delete all occurrences of" block

I'm gonna bump
chrdagos
Scratcher
500+ posts

"Delete all occurrences of" block

KittyFireSt0rm wrote:

BosenChang wrote:

-snip-

Again, I am aware of a workaround, for the
 delete all occurrences of ( ) in [list v] ::list 
block.

The other block
 delete all occurences of ( ) ::list 
is more of a hassle to workaround.
o.k but what would the
 delete all occurences of ( ) ::list 
block do?
KittyFireSt0rm
Scratcher
1000+ posts

"Delete all occurrences of" block

chrdagos wrote:

-snip-

It does exactly what it looks/sounds like, it deletes every occurrence of (foo) in all lists

Last edited by KittyFireSt0rm (Aug. 17, 2020 16:59:12)

j3r0_plays
Scratcher
100+ posts

"Delete all occurrences of" block

Workaround is EASY… And this is required only in pretty rare occasions… So no.
KittyFireSt0rm
Scratcher
1000+ posts

"Delete all occurrences of" block

j3r0_plays wrote:

Workaround is EASY… And this is required only in pretty rare occasions… So no.

The next costume block has an easy workaround, the change variable by foo block has an easy workaround, and they still exist. However you are correct that this is only needed in rare occasions, but it's still useful, and less annoying than having to delete all occurrences of a thing in each list individually
KittyFireSt0rm
Scratcher
1000+ posts

"Delete all occurrences of" block

Bump
KittyFireSt0rm
Scratcher
1000+ posts

"Delete all occurrences of" block

bump
scratchastroLOL
Scratcher
1000+ posts

"Delete all occurrences of" block

bump
KittyFireSt0rm
Scratcher
1000+ posts

"Delete all occurrences of" block

bump

Powered by DjangoBB