ERASE Instruction

The ERASE instruction deletes answers from the interview for a variable or dialog you specify.

 

You can use the ERASE instruction in scripts where you are adding new answers to variables (e.g. with a SET instruction) to first clear the existing answers. If you are using a dialog to temporarily store lists of answers, you can use the ERASE instruction to first clear any existing answers from that dialog. For example, you might have two repeated dialogs—one containing plaintiff names and another containing defendant names. If you need to generate a single list of all parties in the case, you can combine the two lists into a single repeated dialog. To do this, you erase any existing values from the combined list before populating it with the names from the plaintiff and defendant dialogs.

Instruction name Model After you drag and drop the model into the script tab:
ERASE ERASE ⟦VAR,DIALOG⟧ Replace the existing answers with your new answers.

Example

Using the ERASE instruction in the script keeps the combined list up to date each time the computation script is processed. For example, if the user adds or removes names in the plaintiff or defendant dialogs during the interview, the ERASE instruction will make sure they are properly added or removed when the combined list is regenerated.

The template author creates the following components:

The following script demonstrates how to accomplish this:

ERASE Combined List

SET Counter TO 0

REPEAT Plaintiff Information

INCREMENT Counter

SET Combined Name[Counter] TO Plaintiff Name

END REPEAT

REPEAT Defendant Information

INCREMENT Counter

SET Combined Name[Counter] TO Defendant Name

END REPEAT

Download

After you download the example template, you can import the template to any workspace to see this example code in action.