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

> 檢查指定物件中的屬性是否有值，僅當屬性存在且非空時執行正文塊。

export const siteNameShort = "知行之橋";

arc:exists 關鍵字可以檢查指定物件中的屬性是否有值。[arc:notnull](./op-arc-not-null) 關鍵字與 arc:exists 是同義的。

## 參數

* **item**：要檢查的物件。如果未指定，則使用預設的輸出物件。
* **attr**：要檢查的屬性名稱。
* **action**：如果運算式執行結果為 true 要執行的操作。允許的值有：break，continue。

## 控制屬性

無

## 範例

為檔案的物件集定義缺少的 title 屬性：

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

## 另請參閱

* [arc:else](./op-arc-else)：建立一個不滿足條件時執行的程式碼塊。
