# 函式

函式使用 `Function` 關鍵字定義：

```basic
Function {函式名}{型別標籤}({引數}) 
     {語句} 
End Function
```

* `{函式名}` 可以是任意有效識別符號。
* `{型別標籤}` 是函式返回值的型別。如果 `{型別標籤}` 被忽略，則函式預設返回整數值。
* `{引數}` 是一個用逗號分割開來的變數列表，在呼叫函式時將資料傳遞給函式。每個引數有可以有一個獨立的型別標籤。引數永遠為本地變數。

函式可以使用 `Return` 語句返回結果。`Return` 後面可以是表示式。

如果函式沒有 `Return` 語句，或者函式使用了不帶任何表示式的 `Return`，則整數值函式將預設返回 `0`，字串函式預設返回 `""`，自定型別值函式返回 `Null` 物件。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gitbook.ziyuesinicization.site/blitz-basic-language-reference/zh_hant/functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
