Special LIMIT Commands

You associate the special LIMIT commands OMIT and OTHERWISE with REPEAT commands.

Unlike regular LIMIT commands, you do not use a dialog box to define these commands and you cannot edit them. Instead, you select the part of the template to which you want to apply one of these commands.

OMIT Command

You use an OMIT command to omit a section from a Web page when a REPEAT command returns no objects.

For example, you might use a REPEAT command to create a numbered list item for each object. You would use an OMIT command to entirely omit the list and any introduction to it when there are no objects.

To insert an OMIT command:

1. In the template itself, show the existing commands, select the section that you want to omit, including the entire REPEAT command that 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.

2. Click ProjectConsole > Add Command, select Special LIMIT Command: OMIT and click OK.

ProjectConsole Template Builder fills in all required values for the command; there is no dialog box for you to complete.

 

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

Example

Here is a section that is designed to display class diagrams:

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]

([MASTER16] starts the repeat command for the class diagrams.)

 

To suppress this 2.1.1 heading when there are no class diagrams:

1. In the template itself, select the heading through and including [ENDMAST23].

2. Click ProjectConsole > Add Command, select Special LIMIT Command: OMIT, and click OK.

The section now looks like this, with the LIMIT and ENDLIM commands added:

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

You use an OTHERWISE command to include a section of a document only when a REPEAT command returns no objects. For example, you can use an OTHERWISE command to include a paragraph that reads: "No objects were found."

To insert an OTHERWISE command:

1. With commands showing, create the conditional text immediately following the associated REPEAT command.

You might find it helpful to type attribute names where you plan to create DISPLAY commands, if any.

2. Select the text.

3. Click ProjectConsole > Add Command and select the Special LIMIT Command: OTHERWISE.

ProjectConsole Template Builder fills in all required values for the command; there is no dialog box for you to complete.

Example

Here is a section that is designed to display class diagrams:

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]

 

To include a message when there are no diagrams:

1. Put the insertion point after the [ENDMAST23] command and insert a carriage return.

2. Type the message you want to include in the Web page when there are no diagrams.

The message can be one or more paragraphs.

3. Select the message.

4. Click ProjectConsole->Add Command, select Special LIMIT Command: OTHERWISE and click OK.

 

The section now looks like this, with the LIMIT and ENDLIM commands applied:

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 REPEAT command:

1. Create the repeated section and the REPEAT command.

2. Add the OMIT command enclosing the REPEAT command.

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

Note: You must insert the OTHERWISE command outside the scope of the OMIT command so that the OTHERWISE command is not hidden by the OMIT command when the Web page is generated.