# 常量

常量是擁有固定值的變數，在程式執行中不會改變的量。常量可以是任意基本資料型別。常量可以用於定義螢幕解析度等變數。

* **浮點值常量**必須包含小數點。例如：`5` 是整數常量，而 `5.0` 則是浮點常量。
* **字串常量**必須被括號包裹。例如：`"This is a string constant"`。

`Const` 關鍵字被用於定義常量。例如：

```basic
Const one_hundred = 100
```

此後，您可以在程式中的任何位置使用 `one_hundred`，而不是直接使用 `100`。

更有意義的例子是：

```basic
Const width = 640, height = 480
```

之後，您就可以在程式中使用更加可讀的 `width` 和 `height`，而不是 `640` 和 `480`。

此外，如果您想要修改寬度和高度，則只需要在宣告處進行更改。

Blitz 有兩個內建整數值常量：`True` 和 `False`。`True` 等於 `1`，而 `False` 等於 `0`。

Blitz 也有一個內建浮點值常量為 `Pi`。


---

# 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/constants.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.
