Special LIMIT Commands

There are two kinds of special LIMIT commands -- OMIT and OTHERWISE -- both of which are associated with REPEAT commands. These commands, unlike regular LIMIT commands, are not defined through the LIMIT Command dialog box and cannot be edited. Also, descendent SoDA commands cannot use special LIMIT commands for context.

OMIT Command

An OMIT command is used to omit a section from a document when a REPEAT command returns no objects. For example, you could use a REPEAT command to create a numbered list item for each object, and in case there are no objects, you could use an OMIT command to entirely omit the list and any introduction to it.

To insert an OMIT command:

1. Select the section that you want to omit, including the entire REPEAT command which the OMIT command is evaluating. (If the command’s descendants include multiple REPEAT commands, the OMIT command is associated with the "first" or "closest" one.)

Note: If you work in the document, show the existing SoDA commands so you can be sure the cursor position is correct.

2. Choose Add Command from the SoDA menu.

3. Select the Special LIMIT Command: OMIT radio button. SoDA automatically fills in all required values for the command; you do not need to complete a dialog box.

 

Note about the examples below: If you are using Word 2002, a comment marker is associated with each SoDA command. It is the marker that you must select, not the SoDA command display, such as [DISPLAY20]. To read about the annotation differences between the Word versions, see Word 2000 and Word 2002 Comparison.

Example

Consider this section:

2.1.1 Class Diagrams

 [MASTER16][REPEAT17][DISPLAY18]{INCLUDEPICTURE.....}[ENDDISP19]

  [DISPLAY20]<ClassDiagrams.Name>[ENDDISP21] Class Diagram

[Describe the interactions between the classes.]

[ENDREP22][ENDMAST23][ENDREP24][ENDMAST25]

 

Suppose you want to suppress the 2.1.1 heading if there are no class diagrams. Select the heading through and including [ENDMAST23] and do SoDA->Add Command to add the Omit command. ([MASTER16] starts the repeat

command for the class diagrams.)

 

The resulting structure looks like this:

2.1.1 [LIMIT16]Class Diagrams

 [MASTER17][REPEAT18][DISPLAY19]{INCLUDEPICTURE.....}[ENDDISP20]

  [DISPLAY21]<ClassDiagrams.Name>[ENDDISP22] Class Diagram

[Describe the interactions between the classes.]

[ENDREP23][ENDMAST24][ENDLIM25][ENDREP26][ENDMAST27]

 

OTHERWISE Command

An OTHERWISE command is used to include a section of a document only when a REPEAT command returns no objects. For example, you could use an OTHERWISE command to include a paragraph that said: "No objects were found."

To insert an OTHERWISE command:

1. Create the section that may or may not be included. You may find it helpful to type attribute names where you will eventually create DISPLAY commands, if any. The limited section must immediately follow its associated REPEAT command.

Note: If you work in the document, show the existing SoDA commands so you can be sure the cursor position is correct.

2. Select the text. In most cases you will select entire paragraphs, from the beginning of one paragraph to the end of another.

3. Choose Add Command from the SoDA menu..

4. Select the Special LIMIT Command: OTHERWISE radio button. SoDA automatically fills in all required values for the command; you do not need to complete a dialog box.

 

Example

Using the same example as above, we start with this:

2.1.1 Class Diagrams

 [MASTER16][REPEAT17][DISPLAY18]{INCLUDEPICTURE.....}[ENDDISP19]

  [DISPLAY20]<ClassDiagrams.Name>[ENDDISP21] Class Diagram

[Describe the interactions between the classes.]

[ENDREP22][ENDMAST23][ENDREP24][ENDMAST25]

 

This time rather than omitting the heading, we want to include a message if there are no diagrams. To do this we

1. Put your cursor after the [ENDMAST23] annotation and insert a carriage return.

2. Type whatever message you want included into the document if there are no diagrams found. The message can be one or more paragraphs.

3. Select the message.

4. Select SoDA->Add Command and choose Special Limit Command: Otherwise

 

The resulting structure will look like this:

2.1.1 Class Diagrams

 [MASTER16][REPEAT17][DISPLAY18]{INCLUDEPICTURE.....}[ENDDISP19]

  [DISPLAY20]<ClassDiagrams.Name>[ENDDISP21] Class Diagram

[Describe the interactions between the classes.]

[ENDREP22][ENDMAST23]

[LIMIT24]There are no diagrams.[ENDLIM25][ENDREP26][ENDMAST27]

 

Using Both OMIT and OTHERWISE

You can associate both an OMIT and OTHERWISE command with a given REPEAT command. Here’s how:

1. Create the repeated section and the REPEAT command first.

2. Add the OMIT command enclosing the REPEAT command.

3. Add the OTHERWISE following, and outside of, the REPEAT and OMIT commands.

Simply be aware that the OTHERWISE command must be inserted outside the scope of the OMIT command so that the OTHERWISE command is not hidden by the OMIT command when the document is generated.