I have a little math quiz and I display the questions from a list. When a question is displayed, I want the speech recognizer to wait until the person gives an answer, then check the answer.
In the first piece of code, it cycles through the questions and waits until something is typed into the answer box.
In the second piece of code, it cycles through the questions and but does not wait until you say an answer. It will put the answer in the box if you get lucky and say it at the right time.
I think the fact that you inserted the repeat while in the repeat 10 times is not good
May I ask why are you putting wait 1 second blocks everywhere ? What are they meant to do ?
Nice day
I think you like I did have problem with Asynch Loops. Here is what you should do so you can optimize the response time of your app and make it less complicated so we can understand better where does the particular issue you’re talking about is from. Asynchronous Blocks within Loops
I put the waits and the button color changes in there so that I can visually follow where the code is going. It is for debugging and would not be in the final product.
Thanks for helping me out. I will check out the article.
Are the little loops that the first guy does after his save sort of busy work loops that don’t do anything and give time for the save to finish? If so, would a wait 1 second work?
His loops just are functions repeating themselves, so they’ll wait for the answer to come back before executing again, this is meant to replace the repeat 10times
Create one variable called count and another one called counter
Counter is made to count the number of times you’ve executed the procedure, so you change counter by 1 each time the procedure is executed.
Count is the total amount of times you want to execute the function. Each time the procedure ends, you check with an if block if counter < or = (both of them together just don’t have a sign for that on the keyboard ). If it is true you execute the function again, otherwise, you stop the loop.
OK - I tried 2 way to do what you suggested, one with a repeat while and one with “count from 1 to 10 by 1”. both cycled through the list, but neither waited for an answer. If I take the wait 1 seconds out it all happens in an instant.