Statement: Condition, Type: Supporting
Last Answer
Format: initial-condition-statement Last Answer ( Yes | No)
where
Description
The Last Answer is a supporting condition identifier that references the internal variable answer which gets assigned by the Ask action statement. When using the Last Answer identifier in a condition statement, the answer value is compared against either the constant identifier Yes or No to produce a logical true or false result. When the outcome of the condition is evaluated as true the program control is passed to the body of the condition block.
Example
When we reached the end of our session, we are presenting to the user the opportunity to play another session. The results from the dialog box will be stored in the internal variable answer. We will then use the Last Answer identifier with a condition statement to determine if the user wants to quit and stop the session. The following example will perform this task.
RX Script | Copy Code |
---|---|
Ask "Do want to play another session?" if the Last Answer is No then begin Stop Session end |