Maintaining Text on the Screen🔗

keep on the screen, stay on the screen, preserve

There may be instances when you want to keep some text on the screen and not allow it to clear when a new question is introduced. To do this, you can use the *maintain keyword to keep some text maintained on the screen and the *clear keyword when you are ready to clear the text that is being maintained.

*maintain: Make sure to answer honestly.
*question: How are you?
*question: Who do you love the most?
*question: What's a secret you've never told anyone?
*clear

In this example, the user will see "Make sure to answer honestly." Below that will be the first question, "How are you?" After the user answers the first question, "Make sure to answer honestly" will remain, but the first question will disappear and the second question will appear below, and so on. After the last question, the entire screen will be cleared due to the *clear keyword, so "Make sure to answer honestly" will then disappear.

In order to properly clear the maintained text, you must ensure both the *maintain keyword and the *clear keyword are immediately preceded by a question, a button, or a wait period. This means you purposefully time the maintained text and the clearing of that text to occur exactly when you intend them to, and neither will accidentally re-arrange or clear important information. Here's another example:

Your exercise will begin when you click the button
*button: Next

*maintain: Remember to breathe deeply during this guided meditation.

The weather is beautiful and warm
*button: Next

You are in a giant pool of jello
*button: Next

You feel peaceful and at ease
*button: Next

*clear
That's the end!

In the above example, the user sees the first line of text plus a button that says "Next." After clicking the button, the user sees the maintained text at the top of the screen for the three screens that contain meditative imagery. After reading "You feel peaceful and at ease" and pressing the "Next" button, the maintained text disappears and the user only sees "That's the end!"

It's important here that both the *maintain text and the *clear keyword occurred after a button. If we hadn't included a button after the text "Your exercise will begin when you click the button" the user would actually see the maintained text first with this text beneath it. If we hadn't included a button after the text "You feel peaceful and at ease" the user would not actually see this line because it would have been cleared immediately as soon as the user got to that screen. The buttons ensure that the *maintain and *clear keywords are timed appropriately.


Next: