Hi! I had a problem with the ask block before, but thought I managed to fix it. However, I ran into an error with it once again, and after looking into it, I found something really, really strange about the ask block that completely ruins the entire system I have set up. To put it simply, if there are ever multiple spaces back to back, it will remove all but one. So, for example, if I enter something like this:
It returns this:
Why in the world does it do this? Why does the ask block not just report what is typed in? Is there any way to fix this? Or do I just need to rework my entire system?
(Also, I did figure out a workaround. But I am still curious why this is the case to begin with.)
That makes sense from a language standpoint, but it entirely ruins what I'm trying to do. I'm basically using save codes, and the save codes have spaces in them to signal the code that reads it to stop somewhere, or tell it where the end of a section is. The problem is, by it removing spaces, it causes it to break because it receives an invalid code. The error isn't in the code reader; it works fine. The error isn't in the code generator; it works fine, too. The error isn't copying it in; it copies the correct thing in. The error is in the ask block, which modifies the message before sending it to the code reader... for some reason? I have no clue how to fix this.
Because the use case for which ASK was designed was a conversation between the computer and a natural human being, not as a way to encode general data. So it's easier to write the program if you can just focus on the words in the user's answer, which convey the meaning, rather than have to worry about strings testing unequal just because of an extra space. (In particular, people my age routinely put two spaces between sentences.⎵⎵Like this. But modern youth don't.) It's the same reason why string comparison should be case-insensitive.
Because double spaces actually make the text easier to read. In the days of typewriters and early computers, people would use two space characters. Nowadays, spaces after periods are automatically wider, so "youth" won't use a double space.
By the way, the loss of spaces is consistent with Scratch.