This article applies to:
In this sample, a single sentence is broken into several "phrases", separated in individual attributes. Each phrase is displayed one at a time. The displayed phrase is called the "active" phrase. The other phrases are represented by dashes when they are not active.
Two arrays are created - one to store each phrase of the sentence, and another to store the "masked" version of each phrase. In this sample, the "mask" consists of a series of dashes equaling the length of the actual phrase. This can be easily changed to use the mask of your choice, or to use a constant mask (i.e., to hide the length of the phrases before the subject sees them). Once the phrases and masks have been loaded, a few conditions are checked.
To account for longer sentences, the phrase for which a hard return will be used is specified using an attribute. If a phrase is specified, a hard return is added to the specified phrase and its mask. Additionally, for sentences with shorter phrases, an "x" in specified for the empty phrases, which are skipped using a Goto statement and a Label object.
Once these conditions are accounted for, each TextDisplay object is assigned text and then presented to the subject.
SCRIPTING: Arrays