We can join text, but what about split it into pieces?
Like the idea? I do!
Offline
The-Whiz wrote:
So what would it report? What would the answer be?
A list of length 'n' where 'n' is the number of articles. So really this should be in the lists category.
Offline
The-Whiz wrote:
So what would it report? What would the answer be?
good question...
The-Whiz wrote:
Would it report "H" or "ello world"?
Er... Both? IDK
Last edited by illusionist (2009-09-08 19:23:43)
Offline
How does it report two things? That's impossible. Maybe (first part of [hello world] split at (1)) and (last part of [hello world] split at (1))
You could do that...
[when flag clicked] [delete (all) of [letters]] [ask [input?]] [set [text] to (answer)] [set [iterator] to [0]] [repeat (length of (answer))] [][change [iterator] by (1)] [][add (letter (iterator) of (answer)) to [letters] [end repeat] [ask [Split at where?]] [set [split] to (answer)] [set [first] to []] [set [last] to []] [repeat (answer)] [][set [first] to (join (first) (item (1) of [letters])] [][delete (1) of [letters]] [end repeat] [repeat (length of [letters])] [][set [last] to (join (last) (item (1) of [letters])] [][delete (1) of [letters]] [end repeat] [say (join (The first part of ) (join (text) (join ( split at ) (join (split) (join ( is ) (join (first) (join ( and the last part of ) (join (text) (join ( split at ) (join (split) (join ( is ) (join (last) (.))))))))))))]
Last edited by The-Whiz (2009-09-08 19:39:20)
Offline
str$[num1:num2] is how you do it in Truebasic... where the reported value is the substring between the num1 character and the num2 character.
Offline
cool! I want this block !
The input it would probably give when you type in split "hello world" at letter one h ello world. The block would probably look like this (sort of): <split (Hello World) at letter (1)> ...
Another thing is how did you make the block illusionist? It looks so REAL
Last edited by terminator68 (2009-09-19 19:26:43)
Offline