http://www.appinventor.org/bookChapters/chapter10.pdf
^
The program code above is wrong!
^
The above program code is correct!
http://www.appinventor.org/bookChapters/chapter10.pdf
There is no difference in operation between the two examples.
In both cases, the text boxes will be cleared. In your example it will be faster, in the example in the book it will be a little later. However, this difference will be imperceptible to the human eye.
There is a difference.
The wrong program code, after pressing the "NextButton" key, the question and answer are deleted. The question and answer display is blank.
The correct program code is to delete the previous question and answer first, and then display the next question and answer.
If you can really see the difference on your phone by pressing a button, your phone must have an Intel4004 processor.
I do not know what you are testing this code on, but I assure you that on a real phone you will not notice the difference when the fields are cleared because it takes fractions of a second.
After that, the question field is not cleared. The "answer" field and the "right / wrong" field are cleared. The question field is updated with the new question.
We do not produce this model of mobile phone.
Under the App Inventor execution model the two code blocks are equivalent. The blocks run on what is called the UI Thread. All operations on the UI thread occur prior to any subsequent draw operation to update the screen. The code examples above can be decomposed into three unrelated execution units A, B, C. Let A be the execution unit starting at the global set through setting the question text. Let B be the execution unit that sets the AnswerText text to "". Let C be the execution unit that sets the RightWrongLabel text to "". The first code example is A, B, C. The second code example is B, C, A. Because no graphical updates occur until after all the blocks finish executing, you'll still end up with exactly the same outcome visually. This is because the paint operation to redraw the screen cannot occur until after the blocks have finished executing, so reordering unrelated operations within an event results in the same outcome.
Logically this will occur on both code