This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-03-24 20:40:44

ProjectMakerMusic
Scratcher
Registered: 2011-02-19
Posts: 44

New Block

"Replace Item That Contains _______ With ______ in (LIST)

Detects The line that has a certain Word.
It would be a HUGE advance.

I know you CAN do that, but this is easier

Last edited by ProjectMakerMusic (2012-03-24 20:43:31)


big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile
Epicness Is In Here! : http://scratch.mit.edu/projects/Project … ic/2419916

Offline

 

#2 2012-03-25 09:47:22

PencilFactory
Scratcher
Registered: 2011-11-11
Posts: 100+

Re: New Block

Replace Item That Contains [] With [] in [LIST v]


PencilFactory is http://blocks.scratchr.org/API.php?user=PencilFactory&action=onlineStatus&type=text, see my computerhttp://mag.racked.eu/cimage/i9002/Achievement+get%21/Computer+crashed/mca.png

Offline

 

#3 2012-03-25 09:54:22

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: New Block

you mean all items which have 'foo' inside should be replaced with 'baz' or somethin glike that?
well, they'll add some text formating, then you just have to iterate over it  smile

Offline

 

#4 2012-03-25 19:00:44

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: New Block

You mean;

<position of [thing] in [list v]>
?

That'd be cool.


Why

Offline

 

#5 2012-03-25 21:57:28

Mokat
Scratcher
Registered: 2011-12-08
Posts: 1000+

Re: New Block

Support.  smile 
It would be very useful...


http://www.eggcave.com/egg/977371.pnghttp://www.eggcave.com/egg/977376.pnghttp://www.eggcave.com/egg/1005291.pnghttp://www.eggcave.com/egg/996745.png

Offline

 

#6 2012-03-25 21:59:29

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: New Block

But what if there are multiple items that have it? What if you only want a certain number to be replaced?

Offline

 

#7 2012-03-25 22:08:43

ProjectMakerMusic
Scratcher
Registered: 2011-02-19
Posts: 44

Re: New Block

my loophole is a codename.

so bassicly 8B is a code name, and all the other ones would be different


big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile
Epicness Is In Here! : http://scratch.mit.edu/projects/Project … ic/2419916

Offline

 

#8 2012-03-26 14:33:16

Haiming
Scratcher
Registered: 2011-08-20
Posts: 1000+

Re: New Block

In Scratch 2.0, there would be a section where you can make your own scripts.  smile

Offline

 

#9 2012-03-27 06:13:18

soniku3
Scratcher
Registered: 2011-12-08
Posts: 1000+

Re: New Block

support!


internet's all about cats today.

Offline

 

#10 2012-03-28 14:53:53

funelephant
Scratcher
Registered: 2010-07-02
Posts: 1000+

Re: New Block

Support!
I wouldn't support if this was possible

replace item (<[afdsa v]contains [Blah]>) of [afdsa v] with [Blah]

Last edited by funelephant (2012-03-28 14:54:11)


nicki begs to differ
http://24.media.tumblr.com/ab0e6e8fd347c5e39c2821bcab9d16e6/tumblr_mgu35sui1L1rfb7aqo2_500.gif

Offline

 

#11 2012-03-28 18:25:01

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: New Block

when gf clicked
wait until <your ready>
if <[list v] contains [whatever you want]>
set [a v] to [0] //create a variable just for this
repeat until <not<[list v] contains [whatever you want]>>
change [a v] by [1]
if <<item <a> of [list v]> = [whatever you want]>
replace item <a> with [this thing]
end
end
end
That should be a workaround if your looking to replace all the items that fit whatever requirements you put.

Offline

 

#12 2012-03-28 20:38:42

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: New Block

RedRocker227 wrote:

You mean;

<position of [thing] in [list v]>
?

That'd be cool.

<position [1 v] of [thing] in [list v]>

Offline

 

#13 2012-03-28 21:33:22

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: New Block

ImagineIt wrote:

RedRocker227 wrote:

You mean;

<position of [thing] in [list v]>
?

That'd be cool.

<position [1 v] of [thing] in [list v]>

That wouldn't be the same.

<position of [thing] in [list v]>
would be a reporter that would report the # item that has "thing"

Offline

 

Board footer