Discuss Scratch

destructo-serpent
Scratcher
100+ posts

list help

i'm making a list-based word processor, but i don't know how to make a backspace. how would you delete the last character from a list entry? like:

list entry: hello there
(8 key pressed)
list entry: hello ther

Last edited by destructo-serpent (June 11, 2013 20:34:16)

Tezliov
Scratcher
71 posts

list help

The only workaround I can think of is have another hidden list add every individual letter as a different line, and have the main list merge the list together. I'll make an example in a minute.

Edit: Here you go: http://scratch.mit.edu.ezproxyberklee.flo.org/projects/10794390/

Last edited by Tezliov (June 11, 2013 21:01:43)

turkey3
Scratcher
1000+ posts

list help

One way to do it is to make a variable first called changer and another item#. Just follow this script
set [changer] to []
set [item#] to (1)
repeat ((length of (item (4) of list)) - (1))
set [changer] to (join (changer) (letter (item#) of (item (4) of list)
change [item#] by (1)
end
replace item [4] of [list] with (changer)
Assume that item 4 is the item of the text you want to backspace on. This works quickest as a custom block, you can call it “backspace”, running without screen refresh.

Last edited by turkey3 (June 11, 2013 22:09:38)

destructo-serpent
Scratcher
100+ posts

list help

turkey3 wrote:

One way to do it is to make a variable first called changer and another item#. Just follow this script
set [changer] to []
set [item#] to (1)
repeat ((length of (item (4) of list)) - (1))
set [changer] to (join (changer) (letter (item#) of (item (4) of list)
change [item#] by (1)
end
replace item [4] of [list] with (changer)
Assume that item 4 is the item of the text you want to backspace on. This works quickest as a custom block, you can call it “backspace”, running without screen refresh.

it works! thx
Paddle2See
Scratch Team
1000+ posts

list help

Closed by request of the topic owner.

Powered by DjangoBB