Pages: 1
Topic closed
Hey there!
Say you have a list, and one of items has a piece of code similar to this:
Ember,Fire,10
(Hopefully most of you would have realised that this is indeed a move on pokemon where ember is the move, fire is the type and 10 is the damage)
Now I want to split the item into different variables called Move, Type and Damage. Splitting it is quite simple but I was wondering if there is a way to put each into individual variables.
I have tried something similar to taking each letter of the item and adding it onto a variable, and then adding on the next letter, however this doesn't seem to work..
Any ideas would be really helpful!
Thanks

Offline
You can use a processor like this:
Keep in mind it's not instantaneous, but it's quick. (Maybe 15 frames maximum)
Explanation:
First this script breaks your string into individual letters, then compiles the letters together again until it reaches a comma. It splices the letters already compiled together into the first word, skips over the comma, then starts compiling the letters in the next word. It repeats this until the entire thing is separated.
P.S. Wherever it says "Set WordProcess to ' '" don't put a space in there, just delete the zero and leave it empty like that.
P.P.S. Those answer blocks are just so you can test the script out, afterwards you can delete the top block and replace "answer" with the item of the list you are breaking up.
Last edited by Kileymeister_test (2011-06-17 17:27:42)
Offline
Kileymeister_test wrote:
You can use a processor like this:
http://i53.tinypic.com/1193yxg.gif
Keep in mind it's not instantaneous, but it's quick. (Maybe 15 frames maximum)
Explanation:
First this script breaks your string into individual letters, then compiles the letters together again until it reaches a comma. It splices the letters already compiled together into the first word, skips over the comma, then starts compiling the letters in the next word. It repeats this until the entire thing is separated.
P.S. Wherever it says "Set WordProcess to ' '" don't put a space in there, just delete the zero and leave it empty like that.
P.P.S. Those answer blocks are just so you can test the script out, afterwards you can delete the top block and replace "answer" with the item of the list you are breaking up.
Ah excellent! I completely forgot about the "join" block! Thanks for the quick response!

Offline
Topic closed
Pages: 1