I keep finding myself running into the wall that is the lack of string manipulation in Scratch, as I'm sure many others have. To the powers that be: Could you, at the very least, make the [( ) + ( )] block concatenate two strings? (Or am I totally missing something here? What do the rest of you do with your strings?)
Thanks!
Offline
mrweston wrote:
What do the rest of you do with your strings?
We sit around and wish there were string functions!
Actually, you can do a crude concatenation by using Lists. Make list items with all the parts you want concatenated, then you can reference the entire array with the array name and your items will be concatenated - only there will be a space between them (bummer).
Add "Cat" to A_List
Add "Dog" to A_List
Set A_Variable to A_List
will give the variable A_Variable a value of "Cat Dog"
I think Chalkmarrow actually figured out a way to tear "space concatenated" strings apart using string comparison...only I'm not sure it worked online.
Offline
I really do wish there was string concatenation. There is in every programming language... but Scratch. C'mon!! You can concatenate strings via the list function (and that's how I do typing), but that space gets SO annoying. Please, concatenation?
(PS: it's hard to type the word concatenation)
Offline
If you do it with lists, there's always a space between the both texts...
Offline
Yeah, the space can be a deal-breaker, alas. I'm wondering why they chose to insert it in the first place, when assigning an array to a string -- are there cases in which that's really useful? Indicates that it would be an extremely trivial programming tweak to get true concat: just don't append the spaces.
Does anyone from the programming team visit the forums? Or are all these discussions passed on to them by other team members?
Offline
mrweston wrote:
Yeah, the space can be a deal-breaker, alas. I'm wondering why they chose to insert it in the first place, when assigning an array to a string -- are there cases in which that's really useful? Indicates that it would be an extremely trivial programming tweak to get true concat: just don't append the spaces.
Does anyone from the programming team visit the forums? Or are all these discussions passed on to them by other team members?
The space is handy if all you are trying to do is make a printer-friendly method to dump the contents of a list. I think that was the original intent of the space; so that the list could be placed in a Say block. And it works well for that purpose.
As for whether anybody from the programming team visits the forums...I know Jens does from time to time and he is on the programming team. I have been forwarding Scratch and Java Player bugs to the Known Bug List but I have not been forwarding all the Forum discussions.
Offline
And something to split a string
Even just the mid function, and string length should allow us to do everything a
left right would, instring would be nice but we could code that if BYOB becomes part of 1.4
Offline