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

#1 2011-09-07 16:33:14

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

Deleting all text

I am trying to make something where you enter something and if there's any text in it, it gets deleted. I've been wondering, how do I do this? Thanks!

Offline

 

#2 2011-09-07 16:36:17

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: Deleting all text

ImagineIt wrote:

I am trying to make something where you enter something and if there's any text in it, it gets deleted. I've been wondering, how do I do this? Thanks!

Why would you need this?


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#3 2011-09-07 16:49:51

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

Re: Deleting all text

WindowsExplorer wrote:

ImagineIt wrote:

I am trying to make something where you enter something and if there's any text in it, it gets deleted. I've been wondering, how do I do this? Thanks!

Why would you need this?

I'm tying to make something where I only want them to add text but if they add any numbers then I'll just take out the text to make it a number.

Offline

 

#4 2011-09-07 17:29:16

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: Deleting all text

What are you storing the text in?  A variable?  A list?

Or are you just stamping the letters?

Last edited by Kileymeister (2011-09-07 17:29:30)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#5 2011-09-08 16:12:09

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

Re: Deleting all text

Kileymeister wrote:

What are you storing the text in?  A variable?  A list?

Or are you just stamping the letters?

variable.

Last edited by ImagineIt (2011-09-08 16:13:05)

Offline

 

#6 2011-09-08 16:13:54

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Deleting all text

"mixed + 0" should strip off all the letters and leave 0-9 numbers...

EDIT
Never mind that only works with trailing letters. You'll have to manually run through all of the characters if you want to strip out letters.

Last edited by LS97 (2011-09-08 16:15:47)

Offline

 

#7 2011-09-08 16:28:23

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Deleting all text

Make each character an item on a list and run through each item checking if it is a number of not.  If it is a number add it to a different list or "join" it with a variable.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#8 2011-09-08 16:41:09

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

Re: Deleting all text

MoreGamesNow wrote:

Make each character an item on a list and run through each item checking if it is a number of not.  If it is a number add it to a different list or "join" it with a variable.

Thanks!

Last edited by ImagineIt (2011-09-08 17:02:21)

Offline

 

Board footer