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

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

arc:exists 關鍵字可以檢查指定物件中的屬性是否有值。[arc:notnull](https://docs.kasoftware.com/26.4/self-hosted/zh-Hant/scripting/keyword-reference/op-arc-not-null.md) 關鍵字與 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](https://docs.kasoftware.com/26.4/self-hosted/zh-Hant/scripting/keyword-reference/op-arc-else.md)：建立一個不滿足條件時執行的程式碼塊。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.