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

#1 2011-05-14 00:51:27

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

truncation

is there a way to truncate in scratch?


Posts: 20000 - Show all posts

Offline

 

#2 2011-05-14 06:39:38

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: truncation

What do you want to truncate?


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#3 2011-05-14 10:59:07

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: truncation

Harakou wrote:

What do you want to truncate?

a number from the end of a variable


Posts: 20000 - Show all posts

Offline

 

#4 2011-05-14 18:11:42

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

Re: truncation

There's probably a much simpler way, but:
http://i56.tinypic.com/2vwgps2.gif

Edit:  Easier method (but use the first if you're using letters):
http://i51.tinypic.com/2cbqsk.gif

Last edited by Kileymeister (2011-05-14 18:14:42)


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-05-16 04:03:59

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: truncation

Use the (letters (1) through ((length of (text) - (1))) blockwink   tongue

Last edited by scimonster (2011-05-16 04:05:00)

Offline

 

#6 2011-05-16 20:07:16

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: truncation

That requires a modification though. Kileymeister's solution will work in this case, although there may be an easier way.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#7 2011-05-17 02:59:03

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

Re: truncation

Harakou wrote:

That requires a modification though. Kileymeister's solution will work in this case, although there may be an easier way.

The easier way is actually in the link scimonster suggested!  smile

Offline

 

#8 2011-05-17 05:07:11

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: truncation

LS97 wrote:

Harakou wrote:

That requires a modification though. Kileymeister's solution will work in this case, although there may be an easier way.

The easier way is actually in the link scimonster suggested!  smile

Which is why I gave the link.  wink

Offline

 

#9 2011-05-17 17:55:56

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: truncation

LS97 wrote:

Harakou wrote:

That requires a modification though. Kileymeister's solution will work in this case, although there may be an easier way.

The easier way is actually in the link scimonster suggested!  smile

Ah, but then it doesn't work if you want to upload it, making it a real pain.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#10 2011-05-18 03:32:14

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: truncation

Harakou wrote:

LS97 wrote:

Harakou wrote:

That requires a modification though. Kileymeister's solution will work in this case, although there may be an easier way.

The easier way is actually in the link scimonster suggested!  smile

Ah, but then it doesn't work if you want to upload it, making it a real pain.

I linked to a workaround.  wink  It can be used.  big_smile

Offline

 

#11 2011-05-18 12:46:57

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

Re: truncation

scimonster wrote:

Harakou wrote:

LS97 wrote:


The easier way is actually in the link scimonster suggested!  smile

Ah, but then it doesn't work if you want to upload it, making it a real pain.

I linked to a workaround.  wink  It can be used.  big_smile

The replica using Scratch blocks?  That takes more than one frame though.


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

 

#12 2011-05-18 13:07:16

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: truncation

Kileymeister wrote:

scimonster wrote:

Harakou wrote:

Ah, but then it doesn't work if you want to upload it, making it a real pain.

I linked to a workaround.  wink  It can be used.  big_smile

The replica using Scratch blocks?  That takes more than one frame though.

Live with it. ^^

Offline

 

#13 2011-05-18 13:21:40

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

Re: truncation

scimonster wrote:

Kileymeister wrote:

scimonster wrote:


I linked to a workaround.  wink  It can be used.  big_smile

The replica using Scratch blocks?  That takes more than one frame though.

Live with it. ^^

It's just that with my version it only takes a single frame... (look above)


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

 

#14 2011-05-18 13:33:56

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: truncation

Kileymeister wrote:

scimonster wrote:

Kileymeister wrote:


The replica using Scratch blocks?  That takes more than one frame though.

Live with it. ^^

It's just that with my version it only takes a single frame... (look above)

7 vs 5. Mine is shorter, and works for anything.  wink

Offline

 

#15 2011-05-19 12:26:13

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

Re: truncation

scimonster wrote:

Kileymeister wrote:

scimonster wrote:


Live with it. ^^

It's just that with my version it only takes a single frame... (look above)

7 vs 5. Mine is shorter, and works for anything.  wink

He he... thought so. It looked shorter!  smile

Offline

 

#16 2011-05-19 14:59:15

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

Re: truncation

All I'm saying is for the given situation, the shortest, fastest, and easiest method without a Scratch modification is this:
http://i51.tinypic.com/2cbqsk.gif
Let's stop arguing about this.

EDIT:  I believe the argument is coming from you thinking that I'm talking about my first method.  I was talking about my second one, the one in this post.

Last edited by Kileymeister (2011-05-19 15:02:35)


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

 

#17 2011-05-20 04:31:44

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: truncation

Kileymeister wrote:

All I'm saying is for the given situation, the shortest, fastest, and easiest method without a Scratch modification is this:
http://i51.tinypic.com/2cbqsk.gif
Let's stop arguing about this.

EDIT:  I believe the argument is coming from you thinking that I'm talking about my first method.  I was talking about my second one, the one in this post.

But as you said, this one only does numbers.
And your edit is correct.

Offline

 

Board footer