Upgrades for the *clear Keyword
Previously, a *clear keyword cleared the screen of maintained text (text that is held constant at the top of the page with the *maintain keyword). Whenever a *clear keyword was used, there was also some sort of page break, and the clear occurred on the new screen. For example, when there was a question preceding the *clear keyword, the question caused a page break and the new screen was cleared of the maintained text. When there was text preceding a *clear keyword, then the *clear keyword also created a button that said “Next.” The button produced a page break and the very next screen was cleared of the maintained text.
Now, the *clear keyword NO LONGER produces a button that says “Next” when preceded by text. Program writers now have to manually create a “Next” button by adding the code: “*button: Next” before any *clear keywords that are preceded by text. This code is not necessary for *clear keywords preceded by questions. In other words, the *clear keyword no longer forces a button to occur.
This change was made to allow for exciting new elements in GuidedTrack. You are now able to * clear the entire screen of anything on it, not just maintained text! For example, you can have a program like this:
In this sample program, once the timer is up the instructions and the image is cleared from the screen and the user only sees the question, “Where was the cow?” With this new change, the user does not have to click any “Next” buttons in order to see the question.
Note: Without the *wait keyword in place in this sample program, the user would not ever see the instructions and image as the clear would occur immediately. The user would only see the question. Similarly, maintained text will be cleared as soon as the user reaches a screen with a *clear keyword (assuming there’s no *wait keyword). In most cases when you need to clear maintained text, you’ll want the *clear keyword to be the first thing on a new screen, by preceding it with a *question or a *button.
Now here’s another example, using the *wait keyword:
The above program is a countdown. The user will see the text “Countdown” with a number beneath it. To start, this number shown will be 10. Then there will be a wait of 1 second and the number shown will appear to change to 9, then another second wait and 9 will change to 8, and so on. The next-to-last thing users will see is the text “Countdown” and the number 1. Then, the screen will *clear and they will see the words “Blast off!”
In the last section, we talked about how the *while keyword works. Here, *while the variable “seconds” is greater than the number 0, the indented content will repeat indefinitely.
We know the content won’t repeat indefinitely though, because the “seconds” variable is slowly decreasing by 1 each time the program passes this line: >>seconds = seconds – 1. And it passes this line exactly 10 times, until “seconds” = 0 and the *while keyword no longer kicks in. That’s when users will see “Blast off!”.
Here’s how the *clear keyword comes into play. Without it, the user’s screen would begin to look something like this:
However, because we’ve added the *clear keyword, the user’s screen will clear each time they get to the *clear keyword section of the *while content. That means, the words “Countdown” as well as the number on display will disappear and will be quickly be replaced by a new “Countdown” and a new number. Usually these clears happen pretty quickly though, so to the user, it will seem as though “Countdown” stays on the screen the entire time and only the numbers change.
|