> ## 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:else

> 當父級條件關鍵字（如 arc:exists 或 arc:match）不滿足條件時，執行替代程式碼塊。

export const siteNameShort = "知行之橋";

arc:else 關鍵字用來在當 [arc:exists](./op-arc-exists) 或關鍵字 [arc:match](./op-arc-match) 關鍵字匹配例外時，執行另一個程式碼塊。也可以在 [arc:call](./op-arc-call) 中，當呼叫產生輸出物件失敗時執行另一個程式碼塊。

和其它語言不同，ArcScript 要求 arc:else 語句在所屬的測試範圍之內。

## 參數

無

## 控制屬性

無

## 範例

如果檔案沒有名稱則傳回一個佔位符標題：

```xml theme={null}
<arc:call op="fileListDir" out="out">
  <arc:null attr="filename">
    <arc:set attr="title" value="Unnamed File"/>
    <arc:else>
      <arc:set attr="title" value="[filename]"/>
    </arc:else>
  </arc:null>
  <arc:push title="[title]">
  [out.*]
  </arc:push>
</arc:call> 
```

## 另請參閱

* [arc:exists](./op-arc-exists)：檢查屬性是否存在。
* [arc:equals](./op-arc-equals)：檢查相等性。
