arc:finally

Version 22.0.8473


arc:finally

Version 22.0.8473


The arc:finally keyword is used to execute a section of a script after control leaves an arc:call, arc:try, arc:render, or arc:script statement. It is a convenient way to clean up the formatting of generated documents.

Parameters

None

Control Attributes

None

Examples

The arc:finally block is executed when an unhandled exception occurs. This can be used to ensure that tags are closed:

<table>
<arc:call op="listCustomers" out="customer">
  <arc:first>
    <thead>
        <arc:enum item="customer">
          <td>[_attr]</td>
        </arc:enum>
    </thead>
  </arc:first>
  <tr>
      <arc:enum item="customer">
        <td>[_value]</td>
      </arc:enum>
  </tr>
  <arc:finally>
  </table> <!-- ensure tags are still closed -->
  </arc:finally>
</arc:call>

See Also

  • arc:try: Define a scope to catch exceptions.
  • arc:call: Loop over items returned by an operation.
  • arc:render: Generate a document based on an ArcScript template.
  • arc:script: Create a script block.