> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kasoftware.com/llms.txt
> Use this file to discover all available pages before exploring further.

# arc:last

> 使用 arc:last 僅在遇到 arc:call 或 arc:enum 傳回的物件集中的最後一個物件後執行程式碼塊。

export const siteNameShort = "知行之橋";

arc:last 關鍵字範圍內的 ArcScript 關鍵字只會在遇到最後一個物件時，並且僅當 [arc:call](./op-arc-call) 或 [arc:enum](./op-arc-enum) 傳回有物件時才執行。

arc:last 語句只在處理完最後一個物件之後才會執行；保持對物件集中最後一個物件的存取。如果範圍中沒有物件，那麼 [arc:first](./op-arc-first) 或 arc:last 都不會執行。

## 參數

無

## 控制屬性

無

## 範例

從物件集中建立一個 HTML 表，其中每個物件以行的形式表示：

```xml theme={null}
<arc:call op="listCustomers">
  <arc:first>
    <table>
    <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:last>
    </table>
  </arc:last>
</arc:call>
```

## 另請參閱

* [arc:first](./op-arc-first)：只在第一次迭代時執行程式碼塊。
