Unfortunately, the CLEAR instruction model doesn’t really have any use on its own. Its job is simple: to remove all the options and option prompts from the specified multiple choice (“MC”) variable. That’s it. When used in conjunction with the ADD instruction (which adds options & option prompts to a specified MC variable), you end up with a pair of commands that can dynamically build MC variables on the fly, based on whatever data you desire.
For the sake of this example, lets say we are drafting real estate documents. We have BORROWERS RPT, which collects information on…well, borrowers! We have BORRS Full Name CO which constructs the full name of each individual borrower (ie: can only be used inside the repeat). Lastly, we have BORRS Guaranteed MS, which is a multi select MC variable which asks which borrowers have guarantors. Here’s how we’d build our BORRS Guaranteed MS variable:
CLEAR BORRS Guaranteed MS
REPEAT BORROWERS RPT
ADD "«BORRS Name Full CO»" TO BORRS Guaranteed MS
That’s it. We firstly clear the MC variable, then inside an ASK NONE/ASK DEFAULT pair, we add the full name of each borrower to the MC variable. The user may now select borrower names from the MC variable for insertion into the template. In conjunction with the list format applied to the variable, you can quickly and easily generate user-specified lists of any data from any repeat you have in your system.
There are far more uses for CLEAR/ADD, but this covers what we consider to be the most useful one.